in System.Manageme nt, you would set ConnectionOptio ns.EnablePrivil eges
property to true to enable privileges. There is a bug in .NET Framework
v1.0 that prevents privileges from working correctly when the calling
thread is STA. Make your calling thread as MTA as a workaround.
//[STAThread] // For .NET Framework v1.0, comment this to work
around in C#. Add "<MTAThread ()> _" in VB.NET.
public static void Main()
{
ManagementClass osClass = new ManagementClass ("Win32_Operati ngSystem");
in System.Manageme nt, you would set ConnectionOptio ns.EnablePrivil eges
property to true to enable privileges. There is a bug in .NET Framework
v1.0 that prevents privileges from working correctly when the calling
thread is STA. Make your calling thread as MTA as a workaround.
//[STAThread] // For .NET Framework v1.0, comment this to work
around in C#. Add "<MTAThread ()> _" in VB.NET.
public static void Main()
{
ManagementClass osClass = new ManagementClass ("Win32_Operati ngSystem");
in System.Manageme nt, you would set ConnectionOptio ns.EnablePrivil eges
property to true to enable privileges. There is a bug in .NET Framework
v1.0 that prevents privileges from working correctly when the calling
thread is STA. Make your calling thread as MTA as a workaround.
//[STAThread] // For .NET Framework v1.0, comment this to work
around in C#. Add "<MTAThread ()> _" in VB.NET.
public static void Main()
{
ManagementClass osClass = new ManagementClass ("Win32_Operati ngSystem");
Comment