[Mono-list] mono + WMI

Perminov A.A. all at rubl.tomsk.ru
Wed Jun 6 01:30:54 EDT 2007


Hello everyone.
Using mono 1.2.4 A simple example of using 


using System;
using System.Management;
namespace wmi_sample
{
	class MainClass
	{
		public static void Main(string[] args)
		{
			Console.WriteLine("Hello World!");
			string asd = "\\\\192.168.100.66\\root\\cimv2";
			ConnectionOptions co = new ConnectionOptions();
			co.Username = "user";
			co.Password = "passwor";
		}
	}
}


Error :

Unhandled Exception: System.NotImplementedException: The requested
feature is not implemented.
 at System.Management.ConnectionOptions.set_Username(System.Stringvalue)
[0x00000]
in /tmp/scratch/BUILD/mono-1.2.4/mcs/class/System.Management/System.Management/ConnectionOptions.cs:129 
  at hz.MainClass.Main (System.String[] args) [0x00021]
in /home/admin/Documents/Work/C#/hz/hz/Main.cs:17 


If you run the program in windows that : 

Unhandled Exception: System.Security.SecurityException: That
assemblydoes not allow partially trusted callers.
at
System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly
asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle
rmh, SecurityAction action, Object demand, IPermission permThatFailed)
   at hz.MainClass.Main(String[] args)
The action that failed was:
LinkDemand
The assembly or AppDomain that failed was:
hz, Version=1.0.2713.22060, Culture=neutral,
PublicKeyToken=4ec2ecaa11ea0844
The Zone of the assembly that failed was:
Internet
The Url of the assembly that failed was:
file:///Y:/hz/hz/bin/Debug/hz.exe






More information about the Mono-list mailing list