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

后端 未结 8 1813
自闭症患者
自闭症患者 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:53

    From decompiling Microsoft.VisualBasic.dll, the actual code that gets executed when calling My.Application.Info.DirectoryPath is:

    Path.GetDirectoryName(
        new AssemblyInfo(
            Assembly.GetEntryAssembly() ?? Assembly.GetCallingAssembly()).Location);
    

提交回复
热议问题