Ayush Nautiyal

Ayush Nautiyal

  • 1.7k
  • 89
  • 3.5k

How to close Visual Studio 2010 by coding?

Sep 17 2014 5:59 AM
  • I wrote a Console Application, result come, but after Enter debugging stop. but I want to close whole VS 2010 on which Console Application is written. kindly suggest me any coding or any setting to close VS 2010 .
  • class Demo
    {
    static void Main(string[] args)
    {
    DriveInfo[] allDrives = DriveInfo.GetDrives();
    foreach (DriveInfo d in allDrives)
    {
    Console.WriteLine("Drive {0}", d.Name);
    if (d.IsReady == true)
    {
    long i, j, k;
    i = d.TotalSize / (1024 * 1024);
    j = d.AvailableFreeSpace / (1024 * 1024);
    k = i - j;
    // k = d.TotalFreeSpace / (1024 * 1024 * 1024);

    Console.WriteLine("Total size of drive:{0, 15} MB ", i);
    Console.WriteLine("Total available space:{0, 15} MB", j);
    Console.WriteLine("Total Space Used:{0, 15} MB", k);
    }
    }

    Console.ReadLine();

    }
  • Now actually what I want that ,vs 2010 should be close when I enter to stop debug after watching output in DOS. 

Answers (2)