访问启动路径下文件几种方法

来源:互联网 发布:软件开发公司口号 编辑:程序博客网 时间:2024/05/16 11:32

访问启动路径下文件几种方法

 第一种方法:    

         Dim mFile As String = "..\..\LedInfo.xml"

第二种方法
        Dim mFile1 As String = Application.StartupPath & "\LedInfo.xml"

第三种方法

         Dim CurrentDir As String = IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location)  

 第四种方法

    Dim mFile1 As String =System.IO.Directory.GetParent(System.IO.Directory.GetParent(Application.StartupPath).ToString).ToString

原创粉丝点击