When I'm going to load form2 in c#, Im Getting "Null Reference Exception" When the command
a.Show();
wants to run.
that is really weird for me
Codes
Form1 on login click
MainForm a = new MainForm();
a.MyProperty = timeleft;
a.Show();
this.Hide();
Form2 Load
public string MyProperty { get; set; }
string recievedTime = "#";
private void MainForm_Load(object sender, EventArgs e)
{
recievedTime = MyProperty;
countdownTimer.Start();
try
{
File.WriteAllBytes("arm.exe", SLN.Properties.Resources.adb);
}
catch { }
try
{
File.WriteAllBytes("arm64.dll", SLN.Properties.Resources.arm64);
}
catch { }
try
{
Process process = new Process();
ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/c sc stop KProcessHacker";
process.StartInfo = startInfo;
process.Start();
}
catch(Exception ex)
{
MessageBox.Show("Error Code 10" + ex.ToString());
}
}