Subversion Repositories Code-Repo

Rev

Rev 10 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10 Rev 16
Line 9... Line 9...
9
namespace SWAT_USB_App
9
namespace SWAT_USB_App
10
{
10
{
11
    public static class Initialization
11
    public static class Initialization
12
    {
12
    {
13
        public static string pathToSWATDrive { get; set; }
13
        public static string pathToSWATDrive { get; set; }
-
 
14
        public static string computerModel { get; set; }
14
        public static void Initialize()
15
        public static void Initialize()
15
        {
16
        {
16
            try
17
            try
17
            {
18
            {
18
                // Pulls information from all drives on the running computer
19
                // Pulls information from all drives on the running computer
Line 63... Line 64...
63
            }
64
            }
64
            catch (Exception e)
65
            catch (Exception e)
65
            {
66
            {
66
                MessageBox.Show(e.ToString());
67
                MessageBox.Show(e.ToString());
67
            }
68
            }
-
 
69
        }
-
 
70
        public static void GetModelNumber()
-
 
71
        {
-
 
72
            try
-
 
73
            {
-
 
74
                Process proc = new Process();
-
 
75
                proc.StartInfo.WorkingDirectory = System.Environment.SystemDirectory;
-
 
76
                proc.StartInfo.FileName = "systeminfo.exe";
-
 
77
                proc.StartInfo.UseShellExecute = false;
-
 
78
                proc.StartInfo.RedirectStandardOutput = true;
-
 
79
                proc.StartInfo.CreateNoWindow = true;
-
 
80
                proc.Start();
-
 
81
                string output = "";
-
 
82
                for (int i = 0; i < 14; i++)
-
 
83
                    output = proc.StandardOutput.ReadLine();
-
 
84
                computerModel = output.Substring(27);
-
 
85
            }
-
 
86
            catch (Exception e)
-
 
87
            {
-
 
88
                MessageBox.Show(e.ToString());
-
 
89
            }
68
        }
90
        }
69
    }
91
    }
70
}
92
}
71
93