c# 读取 远程 服务器上 的XML
--------------------编程问答-------------------- 这个简单 啊。 源端 写个webservice方法,把这个xml做为参数传出来 就ok了。如果想对框架和结构控制 ,就先把xml 读到dataset里,把这个dataset 当作参数就可以。 --------------------编程问答-------------------- 提示404 或者 未知密码 --------------------编程问答-------------------- 看电影需要无码
交流最好有码 --------------------编程问答-------------------- web页面 和cs窗体 。 调用webservice的方法是一样的。
就是bs 和cs 都一样 。做web引用就可以了。 --------------------编程问答--------------------
在从本地客户端读取WebService中的DataSet
http://blog.csdn.net/cbq926/archive/2008/11/06/3235382.aspx
--------------------编程问答-------------------- Request
string Url = "http://192.168.22.232/asR_KB/up1.xml";
string StringFileName = Url.Substring(Url.LastIndexOf("/") + 1);
string StringFilePath = Request.PhysicalApplicationPath;
if (!StringFilePath.EndsWith("/")) StringFilePath += "/";
MSXML2.XMLHTTP _xmlhttp = new MSXML2.XMLHTTPClass();
_xmlhttp.open("GET", Url, false, "misy","Jumao");
_xmlhttp.send("");
if (_xmlhttp.readyState == 4)
{
// Response.Write("文件已经得到。<br><a href='" + Request.ApplicationPath + StringFileName + "' target='_blank'>");
// Response.Write("查看" + StringFileName + "</a>");
}
else
{
// Response.Write(_xmlhttp.statusText);
//Response.End();
} --------------------编程问答-------------------- 这样行不行?Request 提示不存在 --------------------编程问答-------------------- up --------------------编程问答-------------------- 顶一顶 --------------------编程问答-------------------- webservice 提供接口
form程序访问webservice --------------------编程问答-------------------- up --------------------编程问答-------------------- 顶顶 --------------------编程问答-------------------- 顶是没有用的。要码, --------------------编程问答-------------------- 建议使用WebService --------------------编程问答-------------------- 不是思路呀,
是咋个读取法呀。
不要无码呀 --------------------编程问答-------------------- mark this --------------------编程问答-------------------- 楼主不会用webservice么 --------------------编程问答-------------------- 上面都说了解决办法 --------------------编程问答-------------------- string Url = "http://192.168.22.232/asR_KB/up1.xml";
string StringFileName = Url.Substring(Url.LastIndexOf("/") + 1);
string StringFilePath = Request.PhysicalApplicationPath;
if (!StringFilePath.EndsWith("/")) StringFilePath += "/";
MSXML2.XMLHTTP _xmlhttp = new MSXML2.XMLHTTPClass();
_xmlhttp.open("GET", Url, false, "misy","Jo");
_xmlhttp.send("");
if (_xmlhttp.readyState == 4)
{
// Response.Write("文件已经得到。 <br> <a href='" + Request.ApplicationPath + StringFileName + "' target='_blank'>");
// Response.Write("查看" + StringFileName + " </a>");
}
else
{
// Response.Write(_xmlhttp.statusText);
//Response.End();
}
目前用这种方法读取会提示无效密码,即需要http://192.168.22.232/asR_KB/up1.xml登录账号及密码 --------------------编程问答-------------------- 有没有哪种读取方法不需要 密码,直接跳过读取XML --------------------编程问答-------------------- WebCLient.Download --------------------编程问答-------------------- 可以先下载到临时的文件夹,然后读取xml的内容,用dataset很方便
最后清理掉临时文件
补充:.NET技术 , C#