Get the program running directory

xiaoxiao2021-03-06  39

Do not use Directory.getCurrentDirectory under the .NET Compact Framework, otherwise it will cause an exception, you can use the following method:

Imports System.IO ....... Private RunAppDir As String Private DatabaseFile As String ....... 'run directory acquisition program and database files path string RunAppDir = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly () .Getname (). Codebase) DatabaseFile = Runappdir & "/Abpm.sdf"

转载请注明原文地址:https://www.9cbs.com/read-68862.html

New Post(0)