Web hosting uk - public static int Main(string[] args) { … //
public static int Main(string[] args) { … // Get arguments using System.Environment. string[] theArgs = Environment.GetCommandLineArgs(); Console.WriteLine(”Path to this app is: {0}”, theArgs[0]); … } Specifying Command-Line Arguments with Visual Studio 2005 In the real world, the end user supplies the command-line arguments used by a given application when starting the program. However, during the development cycle, you may wish to specify possible command-line flags for testing purposes. To do so with Visual Studio 2005, double-click the Properties icon from Solution Explorer and select the Debug tab on the left side. From here, specify values using the Command line arguments text box (see Figure 3-2). CHAPTER 3 68 C# LANGUAGE FUNDAMENTALS An Interesting Aside: The System.Environment Class Let s examine the System.Environment class in greater detail. This class allows you to obtain a number of details regarding the operating system currently hosting your .NET application using various static members. To illustrate this class s usefulness, update your Main() method with the following logic: public static int Main(string[] args) { … // OS running this app? Console.WriteLine(”Current OS: {0} “, Environment.OSVersion); // Directory containing this app? Console.WriteLine(”Current Directory: {0} “, Environment.CurrentDirectory); Figure 3-2. Setting command arguments via Visual Studio 2005
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.