VB.net check whether a file is opened or not
2013-09-10 12:36
267 查看
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_file_opened = True
End Try
End Sub
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_file_opened = True
End Try
End Sub
相关文章推荐
- FW - check whether tree is balanced or not - find the max and min of one tree- 2013年12月18日13:12:04
- How To Check Whether Physical Standby is in Sync with the Primary or Not?
- Geeks - Check whether a given graph is Bipartite or not 二分图检查
- dataStructure@ Check whether a given graph is Bipartite or not
- *Check whether a given graph is Bipartite or not
- Check whether a given Binary Tree is Complete or not 解答
- File opened that is not a database file file is encrypted or is not a databa
- Geeks - Check whether a given graph is Bipartite or not 二分图检查
- 判断是否为完全二叉树 Check whether a binary tree is a complete tree or not
- Archive for required library:xxxxx/spring-beans-3.2.4.RELEASE.jar in project XXXXX cannot be read or is not a valid ZIP file
- 使用CocoaPods遇到一个问题:The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update ....
- 启动tomcat 服务报 The file is absent or does not have execute permission
- A program to check if a binary tree is BST or not
- apt update error "E: The package lists or status file could not be parsed or opened."
- rman在nfs文件系统上备份报错(NFS file system where the file is created or resides is not mounted with correct )
- Invalid proguard configuration file path D:\...\proguard.cfg does not exist or is not a regular file
- Create a program the checks all the links in your web page whether they are active or not.
- VC中使用sqlite3_open生成的文件,提示“file is encrypted or is not a database ”
- cannot be read or is not a valid ZIP file
- Could not load file or assembly 'XXX' or one of its dependencies. Access is denied.