Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
start App using command line parameters
#8
Using the AI link you provided, Davider:
 
Code:
Copy      Help
using System;
using System.IO;

class Program
{
    static void Main()
    {
        // Path to the new current directory
        string newCurrentDirectory = @"C:\Your\New\Path";

        // Check if the directory exists before setting it
        if (Directory.Exists(newCurrentDirectory))
        {
            // Set the current directory
            Directory.SetCurrentDirectory(newCurrentDirectory);
            Console.WriteLine("The current directory has been set to: " + Directory.GetCurrentDirectory());
        }
        else
        {
            Console.WriteLine("The specified directory does not exist.");
        }
    }
}


Messages In This Thread
RE: start App using command line parameters - by burque505 - 05-15-2024, 06:36 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)