WebClient WbClient = new WebClient();
WbClient.Credentials = new System.Net.NetworkCredential(username,password);
WbClient.Proxy = null;
WbClient.Headers.Add("CIMOperation", "MethodCall");
WbClient.Headers.Add("CIMMethod", "EnumerateInstances");
WbClient.Headers.Add("CIMObject", var1);
WbClient.Headers.Add("Content-Type", "application/xml");
string res = WbClient.UploadString(new Uri(url),"POST",var2);url类似于http:// 12.144.15.15:2344,var2是proper xml.The服务器在10min.What之后返回null,这是否意味着?
发布于 2013-11-20 10:06:45
将XML转换为string,此方法接受第二个参数(数据类型字符串)作为字符串。
string res = WbClient.UploadString(new Uri(url),var2); MSDN
https://stackoverflow.com/questions/20092721
复制相似问题