WeiXing/Com.cs
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using ThoughtWorks;
using ThoughtWorks.QRCode.Codec;
using System.Drawing;
namespace WeiXing
{
/// <summary>
/// 实用小工具
/// </summary>
public class Com
{
/// <summary>
/// 支付类型 JSAPI--公众号支付、NATIVE--原生扫码支付、APP--app支付
/// </summary>
public enum trade_type
{
公众号支付 = 0,
原生扫码支付 = 1,
APP支付 = 2,
}
/// <summary>
/// 反序列化xml
/// </summary>
/// <param name="xml"></param>
/// <param name="type"></param>
/// <returns></returns>
public static object DeserializeFromXml(string xml, Type type)
{
object result = null;
if (xml != null)
{
using (StringReader r = new StringReader(xml))
{
XmlSerializer xs = new XmlSerializer(type);
result = xs.Deserialize(r);
}
}
return result;
}
/// <summary>
/// 生成64位二维码
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public static string MakeScanQRBase64(string url)
{
string base64 = "";
QRCodeEncoder e = new QRCodeEncoder();
Bitmap bmp = e.Encode(url, System.Text.Encoding.UTF8);
using (MemoryStream ms = new MemoryStream())
后面还有 8 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。