A
AA2e72E
I am trying to understand why this works ...
using (Process ProcRegEdit = Process .Start("REGEDIT.EXE", "/s
C:\\Ajay\\VS2005\\C#\\REGISTRY\\ajay.reg"))
{
ProcRegEdit.WaitForExit(); // Wait indefinitely
if (ProcRegEdit.HasExited)
{
ProcRegEdit.Close();
}
... but this does not.
using (Process ProcRegEdit = new Process())
{
ProcRegEdit.Start("REGEDIT.EXE", "/s
C:\\Ajay\\VS2005\\C#\\REGISTRY\\ajay.reg");
ProcRegEdit.WaitForExit(); // Wait indefinitely
if (ProcRegEdit.HasExited)
{
ProcRegEdit.Close();
}
}
/* NOTES
This line ...
ProcRegEdit.Start("REGEDIT.EXE", "/s
C:\\Ajay\\VS2005\\C#\\REGISTRY\\ajay.reg");
.... generates a build error with the following message
Static member 'member' cannot be accessed with an instance reference;
qualify it with a type name instead
*/
Thanks.
using (Process ProcRegEdit = Process .Start("REGEDIT.EXE", "/s
C:\\Ajay\\VS2005\\C#\\REGISTRY\\ajay.reg"))
{
ProcRegEdit.WaitForExit(); // Wait indefinitely
if (ProcRegEdit.HasExited)
{
ProcRegEdit.Close();
}
... but this does not.
using (Process ProcRegEdit = new Process())
{
ProcRegEdit.Start("REGEDIT.EXE", "/s
C:\\Ajay\\VS2005\\C#\\REGISTRY\\ajay.reg");
ProcRegEdit.WaitForExit(); // Wait indefinitely
if (ProcRegEdit.HasExited)
{
ProcRegEdit.Close();
}
}
/* NOTES
This line ...
ProcRegEdit.Start("REGEDIT.EXE", "/s
C:\\Ajay\\VS2005\\C#\\REGISTRY\\ajay.reg");
.... generates a build error with the following message
Static member 'member' cannot be accessed with an instance reference;
qualify it with a type name instead
*/
Thanks.