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

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

    If you are converting a WPF application, you can use the following:

    System.Reflection.Assembly.GetExecutingAssembly().Location;
    //gets file path with file name
    
    System.Windows.Clipboard;
    
    System.Media.SystemSounds.[Sound].Play();
    
    System.Windows.Application.Current.Shutdown();
    

提交回复
热议问题