B
Bredal Jensen
I'm thinking of soething equivalent to "exitwindows"
Nicholas Paldino said:Bredal,
#using <mscorlib.dll> doesn't so anything for you. Basically, that's a
namespace declaration, and there is no namespace named "mscorlib.dll". In
order to set a reference, you have to right click on the references folder
and then select "add reference". By default though, mscorlib is added as a
reference.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Bredal Jensen said:great , but i do i import "mscorlib.dll"?
i wonder why this :#using <mscorlib.dll>
bothers my compiler?
Bredal Jensen said:so why i'm getting the following error?
..\Form1.cs(23): The type or namespace name 'DllImport' could not be found
(are you missing a using directive or an assembly reference?)
in
message news:[email protected]...Bredal,
#using <mscorlib.dll> doesn't so anything for you. Basically, that's a
namespace declaration, and there is no namespace named "mscorlib.dll".
In
order to set a reference, you have to right click on the references
folder
and then select "add reference". By default though, mscorlib is added as a
reference.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Bredal Jensen said:great , but i do i import "mscorlib.dll"?
i wonder why this :#using <mscorlib.dll>
bothers my compiler?
I'm thinking of soething equivalent to "exitwindows"
Bredal Jensen said:so why i'm getting the following error?
..\Form1.cs(23): The type or namespace name 'DllImport' could not be found
(are you missing a using directive or an assembly reference?)
in
message news:[email protected]...Bredal,
#using <mscorlib.dll> doesn't so anything for you. Basically, that's a
namespace declaration, and there is no namespace named "mscorlib.dll".
In
order to set a reference, you have to right click on the references
folder
and then select "add reference". By default though, mscorlib is added as a
reference.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Bredal Jensen said:great , but i do i import "mscorlib.dll"?
i wonder why this :#using <mscorlib.dll>
bothers my compiler?
I'm thinking of soething equivalent to "exitwindows"
Bredal Jensen said:so why i'm getting the following error?
..\Form1.cs(23): The type or namespace name 'DllImport' could not be found
(are you missing a using directive or an assembly reference?)
Nicholas Paldino said:Bredal,
#using <mscorlib.dll> doesn't so anything for you. Basically, that's a
namespace declaration, and there is no namespace named "mscorlib.dll". In
order to set a reference, you have to right click on the references folder
and then select "add reference". By default though, mscorlib is added as a
reference.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Bredal Jensen said:great , but i do i import "mscorlib.dll"?
i wonder why this :#using <mscorlib.dll>
bothers my compiler?
I'm thinking of soething equivalent to "exitwindows"
Nicholas Paldino said:Bredal,
Sorry, that is:
using System.Runtime.InteropServices;
(no sharp symbol).
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Bredal Jensen said:so why i'm getting the following error?
..\Form1.cs(23): The type or namespace name 'DllImport' could not be found
(are you missing a using directive or an assembly reference?)
in
message news:[email protected]...that'sBredal,
#using <mscorlib.dll> doesn't so anything for you. Basically,
aasnamespace declaration, and there is no namespace named "mscorlib.dll".
In
order to set a reference, you have to right click on the references
folder
and then select "add reference". By default though, mscorlib is added
areference.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
great , but i do i import "mscorlib.dll"?
i wonder why this :#using <mscorlib.dll>
bothers my compiler?
I'm thinking of soething equivalent to "exitwindows"
Nicholas Paldino said:Bredal,
The framework doesn't expose anything like this, but you can shut down
windows by making a call to the ExitWindows or ExitWindowsEx API functions
through the P/Invoke layer.
The declaration for ExitWindows is as follows:
[DllImport("user32.dll", SetLastError=true)]
public static extern bool ExitWindows(
[MarshalAs(UnmanagedType.U4)]
int dwReserved,
[MarshalAs(UnmanagedType.U4)]
int uReserved);
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Bredal Jensen said:I'm thinking of soething equivalent to "exitwindows"
Willy Denoyette said:The framework exposes this through the System.Management classes and WMI's
class Win32_OperatingSystem.
In general using this is the prefered way to shutdown a system on systems
running W2K or higher.
Willy.
message news:[email protected]...Bredal,
The framework doesn't expose anything like this, but you can shut down
windows by making a call to the ExitWindows or ExitWindowsEx API functions
through the P/Invoke layer.
The declaration for ExitWindows is as follows:
[DllImport("user32.dll", SetLastError=true)]
public static extern bool ExitWindows(
[MarshalAs(UnmanagedType.U4)]
int dwReserved,
[MarshalAs(UnmanagedType.U4)]
int uReserved);
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Bredal Jensen said:I'm thinking of soething equivalent to "exitwindows"
Willy Denoyette said:The framework exposes this through the System.Management classes and WMI's
class Win32_OperatingSystem.
In general using this is the prefered way to shutdown a system on systems
running W2K or higher.
Willy.
message news:[email protected]...Bredal,
The framework doesn't expose anything like this, but you can shut down
windows by making a call to the ExitWindows or ExitWindowsEx API functions
through the P/Invoke layer.
The declaration for ExitWindows is as follows:
[DllImport("user32.dll", SetLastError=true)]
public static extern bool ExitWindows(
[MarshalAs(UnmanagedType.U4)]
int dwReserved,
[MarshalAs(UnmanagedType.U4)]
int uReserved);
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Bredal Jensen said:I'm thinking of soething equivalent to "exitwindows"
Bredal Jensen said:I was not able to locate
the System.Management namespace
Willy Denoyette said:Dir you add a reference to System.Management.dll? Guess not.
Willy.