zoukankan      html  css  js  c++  java
  • C#通过http Get方式获取返回页中的XML

            int intProid = Proid;
            
    string strCardid = Cardid;
            
    int intPaytype = Paytype;
            
    int intOrderid = Orderid;
            
    string strKey = Key;
            
    string path = "http://192.168.6.6/cardsys/api/api.php?proid=" + intProid + "&cardid=" + strCardid + "&paytype=" + intPaytype + "&orderid=" + intOrderid + "&key=" + strKey + "";
            
    bool ReturnValue = true;
            ReturnDataset 
    = null;
            ErrorMessage 
    = null;

            
    try
            {
                Uri uri 
    = new Uri(path);
                WebRequest wreq 
    = WebRequest.Create(uri);
                HttpWebResponse wresp 
    = (HttpWebResponse)wreq.GetResponse();
                Stream s 
    = wresp.GetResponseStream();
                StreamReader objReader 
    = new StreamReader(s, System.Text.Encoding.GetEncoding("utf-8"));
                ReturnDataset.ReadXml(objReader);
            }
            
    catch
            {
                ReturnValue 
    = false;
            }
  • 相关阅读:
    [C++]2-5 分数化小数
    [C++]2-4 子序列的和
    [C++]2-3 倒三角形
    [C++]2-2 韩信点兵
    [C++]2-1 水仙花数
    [C++]竞赛模板·数据统计与IO(重定向版与非重定向版)
    数学建模·经验小结
    信息检索·论文写作
    PPT制作
    演讲与语言表达
  • 原文地址:https://www.cnblogs.com/a311300/p/1738621.html
Copyright © 2011-2022 走看看