VB.net check whether a file is opened or not
发布时间:2020-12-17 08:07:33 所属栏目:百科 来源:网络整理
导读:Dim excel_file_opened As Boolean = False Private Sub Test(ByRef sName As String) Dim fs As FileStream Try fs = File.Open(sName,FileMode.Open,FileAccess.Read, FileShare.None ) excel_file_opened = False fs.Close() Catch ex As Exception excel
Dim excel_file_opened As Boolean = False Private Sub Test(ByRef sName As String) Dim fs As FileStreamTry fs = File.Open(sName,FileMode.Open,FileAccess.Read,FileShare.None) excel_file_opened = False fs.Close() Catch ex As Exception excel_file_opened = True End Try End Sub (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |