Exemplo n.º 1
0
        static private void Main(string[] Arguments)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Create a new instance of the window (which may not be shown)
            RegisterPII Instance = new RegisterPII();

            // Check to see if we should hide the window
            bool bShowWindow = true;

            if (Arguments.Length > 0)
            {
                if (Arguments[0].ToLower() == "/silent")
                {
                    bShowWindow = false;
                }
            }

            // Display the window if it isn't hidden
            if (bShowWindow)
            {
                // Show the dialog
                Instance.Show();
                Application.DoEvents();
            }

            // Send the info to the server
            string WebRequest = "http://" + Properties.Settings.Default.CrashReportWebSite + ":80/Crashes/RegisterPII/" + Environment.UserName + "/" + Environment.MachineName + "/" + Instance.MachineIDString;

            SimpleWebRequest.GetWebServiceResponse(WebRequest, null);

            // Display the window for 5 seconds
            DateTime StartTime = DateTime.UtcNow;

            while (DateTime.UtcNow < StartTime.AddSeconds(5))
            {
                Application.DoEvents();
                Thread.Sleep(50);
            }

            Instance.Close();
        }
Exemplo n.º 2
0
		static private void Main( string[] Arguments )
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault( false );

			// Create a new instance of the window (which may not be shown)
			RegisterPII Instance = new RegisterPII();
			
			// Check to see if we should hide the window
			bool bShowWindow = true;
			if( Arguments.Length > 0 )
			{
				if( Arguments[0].ToLower() == "/silent" )
				{
					bShowWindow = false;
				}
			}
			
			// Display the window if it isn't hidden
			if( bShowWindow )
			{
				// Show the dialog
				Instance.Show();
				Application.DoEvents();
			}

			// Send the info to the server
			string WebRequest = "http://" + Properties.Settings.Default.CrashReportWebSite + ":80/Crashes/RegisterPII/" + Environment.UserName + "/" + Environment.MachineName + "/" + Instance.MachineIDString;
			SimpleWebRequest.GetWebServiceResponse( WebRequest, null );

			// Display the window for 5 seconds
			DateTime StartTime = DateTime.UtcNow;
			while( DateTime.UtcNow < StartTime.AddSeconds( 5 ) )
			{
				Application.DoEvents();
				Thread.Sleep( 50 );
			}

			Instance.Close();
		}