FormWexinEvent.cs
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using AppManager.Config;
using AppManager.Pojo;
using AppManager.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Net;
using System.Windows.Forms;
namespace AppManager {
partial class Form1 {
private void SendButton_Click(object sender, EventArgs e) {
string appId = AppIdTextBox.Text;
string secret = SecretTextBox.Text;
if (string.IsNullOrEmpty(TokenUrlTextBox.Text)) {
MessageBox.Show("Token Url不能为空!");
return;
}
if (string.IsNullOrEmpty(CodeUrlTextBox.Text)) {
MessageBox.Show("Code Url不能为空!");
return;
}
string token = getToken(appId, secret);
Dictionary<string, object> dic = new Dictionary<string, object>();
string key1 = ParamKey1TextBox.Text;
string key2 = ParamKey2TextBox.Text;
string key3 = ParamKey3TextBox.Text;
string key4 = ParamKey4TextBox.Text;
if (!string.IsNullOrEmpty(key1)) {
dic.Add(key1, Str2Object(ParamValue1TextBox.Text, ParamType1ComboBox.Text));
}
if (!string.IsNullOrEmpty(key2)) {
dic.Add(key2, Str2Object(ParamValue2TextBox.Text, ParamType2ComboBox.Text));
}
if (!string.IsNullOrEmpty(key3)) {
dic.Add(key3, Str2Object(ParamValue3TextBox.Text, ParamType3ComboBox.Text));
}
if (!string.IsNullOrEmpty(key4)) {
dic.Add(key4, Str2Object(ParamValue4TextBox.Text, ParamType4ComboBox.Text));
}
string url = $"{CodeUrlTextBox.Text}?access_token={token}";
HttpWebResponse response = HttpUtils.GetPostResponse(url, JsonConvert.SerializeObject(dic));
if (HttpStatusCode.OK == response.StatusCode) {
using (Stream codeImageStream = response.GetResponseStream()) {
image = Image.FromStream(codeImageStream);
int width = CodePictureBox.Width;
int height = CodePictureBox.Height;
// 创建新的Bitmap对象,用于保存缩放后的图片
Bitmap bitmap = new Bitmap(width, height);
using (Graphics g = Graphics.FromImage(bitmap)) {
// 设置高质量抗锯齿
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
// 缩放图片并绘制到Bitmap对象中
g.DrawImage(image, 0, 0, width, height);
}
后面还有 82 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。