Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

vb.net

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()
like image 944
Aaron Hoffman Avatar asked Jul 23 '09 22:07

Aaron Hoffman


People also ask

Can you convert VB to C#?

Code Converter (VB - C#)Adds context menu items to convert projects/files between VB.NET and C#. Flexible: Convert a small selection, or a whole solution in one go, in either direction. Accurate: Full project context (through Roslyn) is used to get the most accurate conversion.

Can you convert Java to C#?

The Java Language Conversion Assistant (JLCA) is a tool that provides the ability to convert Java code and library calls to Microsoft Visual C# . NET.


2 Answers

Application.ExecutablePath

System.Windows.Forms.Clipboard

System.Media.*

Application.Exit

like image 150
TheCodeMonk Avatar answered Sep 26 '22 12:09

TheCodeMonk


My.Application.Info.DirectoryPath
  AppDomain.CurrentDomain.BaseDirectory

My.Computer.Clipboard
  System.Windows.Clipboard //(WPF)
  System.Windows.Forms.Clipboard //(WinForms)

My.Computer.Audio.PlaySystemSound()
  System.Media.SystemSounds.*.Play()

My.Application.Shutdown()
  System.Windows.Forms.Application.Exit() //(WinForms)
  or
  System.Windows.Application.Current.Shutdown()  //(WPF)
  or
  System.Environment.Exit(ExitCode)  //(Both WinForms & WPF)
like image 27
Srinidhi Avatar answered Sep 23 '22 12:09

Srinidhi