• 大小: 1.65MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-10
  • 语言: ASP
  • 标签: .Net  C#  微信  

资源简介

用aspx.net做的微信公众号支付,把payConfig替换成自己的数据发布到微信公众平台自己配置的url就可以跑起来,哪里有问题可以在下面评论或者加QQ358520859,如果这个dome没问题请给个满星好评。谢谢

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;

namespace WeiPay
{
    public class HttpUtil
    {

        private const string sContentType = “application/x-www-form-urlencoded“;
        private const string sUserAgent = “Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727)“;
        public static string Send(string data string url)
        {
            return Send(Encoding.GetEncoding(“UTF-8“).GetBytes(data) url);
        }

        public static string Send(byte[] data string url)
        {
            Stream responseStream;
            HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
            if (request == null)
            {
                throw new ApplicationException(string.Format(“Invalid url string: {0}“ url));
            }
            // request.UserAgent = sUserAgent;  
            request.ContentType = sContentType;
            request.Method = “POST“;
            request.ContentLength = data.Length;
            Stream requestStream = request.GetRequestStream();
            requestStream.Write(data 0 data.Length);
            requestStream.Close();
            try
            {
                responseStream = request.GetResponse().GetResponseStream();
            }
            catch (Exception exception)
            {
                throw exception;
            }
            string str = string.Empty;
            using (StreamReader reader = new StreamReader(responseStream Encoding.GetEncoding(“UTF-8“)))
            {
                str = reader.ReadToEnd();
            }
            responseStream.Close();
            return str;
        }  
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-12-06 10:25  WXPayDome\.vs\
     目录           0  2017-12-06 10:25  WXPayDome\.vs\config\
     文件       85905  2018-02-25 10:48  WXPayDome\.vs\config\applicationhost.config
     目录           0  2018-01-31 16:13  WXPayDome\.vs\WeiPayDemo\
     目录           0  2017-12-06 10:25  WXPayDome\.vs\WeiPayDemo\v14\
     文件      108032  2018-03-02 19:03  WXPayDome\.vs\WeiPayDemo\v14\.suo
     目录           0  2018-01-31 16:14  WXPayDome\.vs\WeiPayDemo\v15\
     文件       82944  2018-02-25 10:50  WXPayDome\.vs\WeiPayDemo\v15\.suo
     目录           0  2018-01-31 16:14  WXPayDome\.vs\WeiPayDemo\v15\Server\
     目录           0  2018-02-25 10:50  WXPayDome\.vs\WeiPayDemo\v15\Server\sqlite3\
     文件           0  2018-01-31 16:14  WXPayDome\.vs\WeiPayDemo\v15\Server\sqlite3\db.lock
     文件     1454080  2018-02-25 10:50  WXPayDome\.vs\WeiPayDemo\v15\Server\sqlite3\storage.ide
     目录           0  2018-03-08 15:23  WXPayDome\WeiPay\
     目录           0  2017-03-12 12:05  WXPayDome\WeiPay\bin\
     目录           0  2017-03-12 12:05  WXPayDome\WeiPay\bin\Debug\
     文件       14336  2018-01-31 16:15  WXPayDome\WeiPay\bin\Debug\WeiPay.dll
     文件       40448  2018-01-31 16:15  WXPayDome\WeiPay\bin\Debug\WeiPay.pdb
     文件      397312  2014-11-26 14:49  WXPayDome\WeiPay\bin\Newtonsoft.Json.dll
     目录           0  2017-12-06 10:19  WXPayDome\WeiPay\bin\Release\
     文件       13824  2018-02-05 10:59  WXPayDome\WeiPay\bin\Release\WeiPay.dll
     文件       36352  2018-02-05 10:59  WXPayDome\WeiPay\bin\Release\WeiPay.pdb
     文件       14336  2017-11-30 22:10  WXPayDome\WeiPay\bin\WeiPay.dll
     文件       12288  2017-11-30 22:10  WXPayDome\WeiPay\bin\WeiPayWeb.dll
     目录           0  2017-12-06 10:19  WXPayDome\WeiPay\DLL\
     文件      397312  2014-11-26 14:49  WXPayDome\WeiPay\DLL\Newtonsoft.Json.dll
     文件        1809  2014-11-26 14:46  WXPayDome\WeiPay\HttpUtil.cs
     目录           0  2017-12-06 10:19  WXPayDome\WeiPay\JS\
     文件       91577  2014-11-26 14:48  WXPayDome\WeiPay\JS\jquery.js
     文件        5988  2014-11-26 14:48  WXPayDome\WeiPay\JS\lazyloadv3.js
     文件        1680  2015-03-20 10:07  WXPayDome\WeiPay\LogUtil.cs
     文件        1268  2014-11-26 14:46  WXPayDome\WeiPay\MD5Util.cs
............此处省略115个文件信息

评论

共有 条评论