Convert VB to C# - My.Application.Info.DirectoryPath

后端 未结 8 1724
自闭症患者
自闭症患者 2021-02-04 06:35

What are the best C# (csharp) equivalents for the following VB (VB.NET, VisualBasic) statements:

My.Application.Info.DirectoryPath

My.Computer.Clipboard

My.Com         


        
8条回答
  •  [愿得一人]
    2021-02-04 06:45

    System.IO.Directory.GetParent(Application.ExecutablePath) 
    

    is exactly the same as:

    My.Application.Info.DirectoryPath
    

    If you only do:

    Application.ExecutablePath
    

    You will get the executing file appended to the path, which may not be useful at all.

提交回复
热议问题