PC_Spy_Info_Program
1| /*
2| NTC C# II Programming 152-124
3| Instructor: John Heckendorf
4| Student: Keith Gallistel
5| Lab ID: <35176>
6|
7| Project Name: PC Spy Info
8|
9|
10| Maintenance Log: | ||
11| By: | Date: | Change: |
12| Keith Gallistel | 10/13/08 | -started project-added main class code |
13| | -created Retrieve_Information_Class | |
14| | -got it to compile and show information in a | |
15| | message box. | |
16| | ||
17| Keith Gallistel | 10/20/08 | -got it to work with DB_Interface_DLL |
18| | -now program stores information in a database | |
19| | -connected PC Spy Info to PC Spy Menu | |
20| | ||
21| Keith Gallistel | 11/03/08 | -One last check over to make sure it worked. |
22| */ |
23|
24|
25| using System;
26| using System.Collections.Generic;
27| using System.Linq;
28| using System.Text;
29|
30| //add references
31| using System.Windows.Forms;
32| using DB_Interface_DLL;
33|
34| namespace PC_Spy_Info
35| {
36| class PC_Spy_Info_Program
37| {
38| static void Main(string[] args)
39| {
40| string sDatabase = "E:\\CS Prog 2\\Class_6to8\\PC_Spy_System\\exe\\databases\\dbPC_Spy.mdb";
41|
42| string sUserID = "";
43| string sUserDate = "";
44| string sUserTime = "";
45| string sFormatteDate = "";
46| string sMilitaryTime = "";
47|
48| bool bAdded = false;
49|
50| if (args.Length == 1)
51| {
52| sDatabase = args[0];
53| }
54|
55| //Declare and instantiate an object
56| Retrieve_Information_Class oRIC = new Retrieve_Information_Class();
57|
58| sUserID = oRIC.Get_UserID();
59| sUserDate = oRIC.Get_User_Date();
60| sUserTime = oRIC.Get_User_Time();
61| sFormatteDate = oRIC.Get_Formatted_Date();
62| sMilitaryTime = oRIC.Get_Military_Time();
63|
64|
65| //Instanciate an object in temporary fields.
66| DB_Interface_DLL.DB_Interface_DLL_Class oDB = new DB_Interface_DLL.DB_Interface_DLL_Class();
67|
68| //Move data to temporary fields.
69| DB_Interface_DLL.Table_Fields_Class.sUserID = sUserID;
70|
71| //open database connection
72| oDB.OpenDB(sDatabase);
73|
74| if (DB_Interface_DLL_Class.bDBOpenSW)
75| {
76| Table_Fields_Class.sUserID = sUserID;
77| Table_Fields_Class.sUserDate = sUserDate;
78| Table_Fields_Class.sUserTime = sUserTime;
79| Table_Fields_Class.sFormattedDate = sFormatteDate;
80| Table_Fields_Class.sMilitaryTime = sMilitaryTime;
81|
82| bAdded = oDB.AddRecord();
83|
84|
85| oDB.CloseDB();
86| }
87| //MessageBox.Show(sUserID + "\n" + sUserDate + "\n " + sUserTime + "\n" + sMilitaryTime + "\n" + sFormatteDate);
88|
89| }//end of main
90|
91| }//end of class
92| }