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;
            }
  • 相关阅读:
    测试PHP-FPM的工作流中的疑惑点
    摘要
    Centrifugo简单试用
    react-redux的基本用法
    PHP中使用ElasticSearch(二)
    PHP中使用ElasticSearch(一)
    Vue中的状态管理器
    Laravel数据库迁移
    快速搭建一个vue开发环境
    使用cURL尝试ElasticSearch
  • 原文地址:https://www.cnblogs.com/a311300/p/1738621.html
Copyright © 2011-2022 走看看