1 Star 0 Fork 101

chenkaixiang/weixinHttpApi

forked from codeman35/weixinHttpApi 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
MainForm_Service.cs 5.05 KB
一键复制 编辑 原始数据 按行查看 历史
codeman35 提交于 2016-01-05 19:16 . no commit message
using FluorineFx.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Web;
using System.Windows.Forms;
using System.Xml;
namespace WeiXinZhuaFaWang
{
public partial class MainForm : Form
{
/// <summary>
/// 收钱发送到远程服务器处理
/// </summary>
/// <param name="Form"></param>
/// <param name="FormName"></param>
/// <param name="ad"></param>
/// <param name="img"></param>
void SendMoney(string Form, string FormName, string msg)
{
var xm = SubString(msg,"<des><![CDATA[", "向你付钱成功,已存入零钱时间");
//z.etuling.com:10001/money
//把图片上传到服务器上。
using (WebClient wc = new WebClient())
{
wc.Encoding = Encoding.UTF8;
var ret = wc.UploadString("http://hz1.yunto.cc/money2?t=" + DateTime.Now ,
"post",
JavaScriptConvert.SerializeObject(new{
Form = Form,
FormName = FormName,
msg = msg
}));
if (ret == "")
ret = "处理授权失败";
try
{
var userform = USER_DI.Where(o => o.Value == xm).Select(o => { return o.Key; }).FirstOrDefault();
if (userform != null)
SendMsg(userform, USER_INFO, ret, false);
}
catch { }
}
}
void SendJiHuo(string Form, string FormName, string msg)
{
SendMsg(Form, USER_INFO, "正在激活...", false);
//z.etuling.com:10001/money
//把图片上传到服务器上。
using (WebClient wc = new WebClient())
{
wc.Encoding = Encoding.UTF8;
var ret = wc.UploadString("http://hz1.yunto.cc/jihuo2?t=" + DateTime.Now,
"post",
JavaScriptConvert.SerializeObject(new
{
Form = Form,
FormName = FormName,
msg = msg
}));
if (ret == "")
ret = "处理激活失败";
else
{
Thread.Sleep(1000);
SendMsg(Form, USER_INFO, ret, false);
}
}
}
///// <summary>
///// 发送远程服务器图片
///// </summary>
///// <param name="Form"></param>
///// <param name="FormName"></param>
///// <param name="ad"></param>
///// <param name="img"></param>
//void SendImage(string Form, string FormName, string ad, Image img)
//{
// //把图片上传到服务器上。
// using (WebClient wc = new WebClient())
// {
// wc.Encoding = Encoding.UTF8;
// var byt = wc.UploadData(domain + "/zf/u?t=" + DateTime.Now + "&uid=" + HttpUtility.UrlEncode(Form) + "&name=" + HttpUtility.UrlEncode(FormName) + "&ad=" + System.Web.HttpUtility.UrlEncode(ad),
// Encoding.UTF8.GetBytes(GetBase64FromImage(img)));
// var ret = Encoding.UTF8.GetString(byt);
// if (ret == "")
// ret = "图片处理失败,请重新发送图片";
// SendMsg(Form, USER_INFO, ret, false);
// }
//}
/// <summary>
/// 修改远程服务器链接
/// </summary>
/// <param name="msg"></param>
/// <param name="Form"></param>
/// <param name="FormName"></param>
/// <param name="ad"></param>
//void ChangeUrl(string msg, string Form, string FormName, string ad)
//{
// try
// {
// using (WebClient wc = new WebClient())
// {
// wc.Encoding = Encoding.UTF8;
// var ret = wc.UploadString(domain + "/zf/a?t=" + DateTime.Now,
// "post",
// "uid=" + HttpUtility.UrlEncode(Form) + "&name=" + HttpUtility.UrlEncode(FormName) + "&ad=" + HttpUtility.UrlEncode(ad) + "&purl=" + HttpUtility.UrlEncode(msg)
// );
// if(ret != "")
// SendMsg(Form, USER_INFO, ret, false);
// }
// }
// catch
// {
// SendMsg(Form, USER_INFO, "发送广告链接出现错误!", false);
// }
//}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/chenkaixiang/weixinHttpApi.git
git@gitee.com:chenkaixiang/weixinHttpApi.git
chenkaixiang
weixinHttpApi
weixinHttpApi
master

搜索帮助