What are the best C# (csharp) equivalents for the following VB (VB.NET, VisualBasic) statements:
My.Application.Info.DirectoryPath
My.Computer.Clipboard
My.Computer.Audio.PlaySystemSound()
My.Application.Shutdown()
What are the best C# (csharp) equivalents for the following VB (VB.NET, VisualBasic) statements:
My.Application.Info.DirectoryPath
My.Computer.Clipboard
My.Computer.Audio.PlaySystemSound()
My.Application.Shutdown()
This may not be exactly what you're looking for, but just in case you want to take a shortcut, if you add a reference to the Microsoft.VisualBasic assembly, you can use the nifty tools VB programmers have access via the MyServices namespace.
Application.ExecutablePath
System.Windows.Forms.Clipboard
System.Media.*
Application.Exit
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();