代理版本调试

This commit is contained in:
wule_5900x committed 2026-07-05 22:55:04 +08:00
1 parent dcdfa30419
commit 1669305479
34 files changed
+4872 -184

No files matched your search

+236
View File
@@ -0,0 +1,236 @@
namespace Work._29Tools.Forms.ToolForms
{
partial class ShowImgForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShowImgForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label();
this.btnSave = new DevComponents.DotNetBar.PanelEx();
this.btnCopy = new DevComponents.DotNetBar.PanelEx();
this.btnCopyUrl = new DevComponents.DotNetBar.PanelEx();
this.btnClose = new DevComponents.DotNetBar.PanelEx();
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// pbCloseBase
//
this.pbCloseBase.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.pbCloseBase.Location = new System.Drawing.Point(616, 0);
//
// splitContainer1
//
this.splitContainer1.BackColor = System.Drawing.Color.White;
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer1.Location = new System.Drawing.Point(1, 33);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.pictureBox1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.label1);
this.splitContainer1.Panel2.Controls.Add(this.btnSave);
this.splitContainer1.Panel2.Controls.Add(this.btnCopy);
this.splitContainer1.Panel2.Controls.Add(this.btnCopyUrl);
this.splitContainer1.Panel2.Controls.Add(this.btnClose);
this.splitContainer1.Size = new System.Drawing.Size(648, 686);
this.splitContainer1.SplitterDistance = 648;
this.splitContainer1.TabIndex = 1;
this.splitContainer1.TabStop = false;
//
// pictureBox1
//
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(648, 648);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(263, 7);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(188, 17);
this.label1.TabIndex = 518;
this.label1.Text = "点击图片或按空格键切换列表图片";
this.label1.Visible = false;
//
// btnSave
//
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSave.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSave.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSave.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSave.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSave.Location = new System.Drawing.Point(178, 2);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(65, 26);
this.btnSave.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnSave.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSave.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSave.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnSave.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnSave.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnSave.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnSave.Style.GradientAngle = 90;
this.btnSave.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnSave.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSave.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSave.TabIndex = 505;
this.btnSave.Text = "保存本地";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// btnCopy
//
this.btnCopy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCopy.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnCopy.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCopy.DisabledBackColor = System.Drawing.Color.Empty;
this.btnCopy.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCopy.Location = new System.Drawing.Point(107, 2);
this.btnCopy.Name = "btnCopy";
this.btnCopy.Size = new System.Drawing.Size(65, 26);
this.btnCopy.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnCopy.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnCopy.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnCopy.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnCopy.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnCopy.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnCopy.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnCopy.Style.GradientAngle = 90;
this.btnCopy.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnCopy.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnCopy.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnCopy.TabIndex = 492;
this.btnCopy.Text = "复制图片";
this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
//
// btnCopyUrl
//
this.btnCopyUrl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCopyUrl.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnCopyUrl.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCopyUrl.DisabledBackColor = System.Drawing.Color.Empty;
this.btnCopyUrl.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCopyUrl.Location = new System.Drawing.Point(6, 2);
this.btnCopyUrl.Name = "btnCopyUrl";
this.btnCopyUrl.Size = new System.Drawing.Size(94, 26);
this.btnCopyUrl.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnCopyUrl.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnCopyUrl.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnCopyUrl.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnCopyUrl.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnCopyUrl.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnCopyUrl.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnCopyUrl.Style.GradientAngle = 90;
this.btnCopyUrl.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnCopyUrl.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnCopyUrl.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnCopyUrl.TabIndex = 488;
this.btnCopyUrl.Text = "复制图片地址";
this.btnCopyUrl.Click += new System.EventHandler(this.btnCopyUrl_Click);
//
// btnClose
//
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnClose.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClose.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnClose.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClose.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClose.Location = new System.Drawing.Point(586, 2);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(56, 26);
this.btnClose.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnClose.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClose.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClose.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnClose.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnClose.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnClose.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnClose.Style.GradientAngle = 90;
this.btnClose.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnClose.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClose.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClose.TabIndex = 481;
this.btnClose.Text = "关闭";
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// ShowImgForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(650, 720);
this.Controls.Add(this.splitContainer1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.IsShowMaxBox = true;
this.KeyPreview = true;
this.Name = "ShowImgForm";
this.Padding = new System.Windows.Forms.Padding(1);
this.Text = "图片查看";
this.TitleText = "图片查看";
this.Load += new System.EventHandler(this.ShowImgForm_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ShowImgForm_KeyDown);
this.Controls.SetChildIndex(this.splitContainer1, 0);
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).EndInit();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.PictureBox pictureBox1;
private DevComponents.DotNetBar.PanelEx btnClose;
private DevComponents.DotNetBar.PanelEx btnCopy;
private DevComponents.DotNetBar.PanelEx btnCopyUrl;
private DevComponents.DotNetBar.PanelEx btnSave;
private System.Windows.Forms.Label label1;
}
}
@@ -0,0 +1,199 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Work.BaseForms;
namespace Work._29Tools.Forms.ToolForms
{
public partial class ShowImgForm : BaseGeneralForm
{
string currentImgUrl = null;
Dictionary<string, string> imgDic = new Dictionary<string, string>();
public ShowImgForm(string picUrl)
{
InitializeComponent();
currentImgUrl = picUrl;
if (!string.IsNullOrEmpty(currentImgUrl))
{
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
//string getImgError = "";
//var image = AllBase.GetHtml.GetUrlImg(currentImgUrl, out getImgError);
//if (!string.IsNullOrEmpty(getImgError))
// //BaseMsgForm.ShowError("图片加载失败 " + getImgError);
// image = TemuKJD.Properties.Resources.errpic;
//this.pictureBox1.Image = image;
}
}
public ShowImgForm(string picUrl, Dictionary<string, string> picDic)
{
InitializeComponent();
currentImgUrl = picUrl;
if (picDic != null)
imgDic = picDic;
if (!string.IsNullOrEmpty(currentImgUrl))
{
if (picDic != null)
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
}
}
public ShowImgForm(Image img)
{
InitializeComponent();
if (img != null)
{
this.pictureBox1.Image = img;
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
private void ShowImgForm_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
{
//case Keys.A: MessageBox.Show("您按下的是A"); break;
//case Keys.B: MessageBox.Show("您按下的是B"); break;
case Keys.Enter: break;
case Keys.Escape: this.Close(); break;
case Keys.Space:
if (imgDic != null && imgDic.Keys.Count > 0)
{
for (int i = 0; i < imgDic.Keys.ToList().Count; i++)
{
if (imgDic.Keys.ToList()[i] == currentImgUrl)
{
int index = i + 1;
if (index == imgDic.Keys.Count)
index = 0;
currentImgUrl = imgDic.Keys.ToList()[index];
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
break;
}
if (imgDic[imgDic.Keys.ToList()[i]] == currentImgUrl)
{
int index = i + 1;
if (index == imgDic.Keys.Count)
index = 0;
currentImgUrl = imgDic[imgDic.Keys.ToList()[index]];
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
break;
}
}
}
break;
}
}
private void btnCopyUrl_Click(object sender, EventArgs e)
{
try
{
Clipboard.SetText(currentImgUrl); // 设置剪贴板内容
BaseMsgForm.ShowInfo("图片地址已复制到剪贴板");
}
catch (Exception ex)
{
BaseMsgForm.ShowError("复制图片地址到剪贴板失败: " + ex.Message);
}
}
private void btnCopy_Click(object sender, EventArgs e)
{
try
{
Clipboard.SetImage(this.pictureBox1.Image); // 设置剪贴板内容
this.btnCopy.Text = "已复制";
Task.Run(() =>
{
Thread.Sleep(2500);
Invoke(new Action(() => { this.btnCopy.Text = "复制图片"; }));
});
//BaseMsgForm.ShowInfo("图片已复制到剪贴板");
}
catch (Exception ex)
{
BaseMsgForm.ShowError("复制图片到剪贴板失败: " + ex.Message);
}
}
private void btnSave_Click(object sender, EventArgs e)
{
if(this.pictureBox1.Image == null)
{
BaseMsgForm.ShowError("图片为空!");
return;
}
string fileName = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + ".jpg";
if (!string.IsNullOrEmpty(this.pictureBox1.ImageLocation))
{
fileName = this.pictureBox1.ImageLocation.Replace("://",".").Replace('/', '.');
}
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "JPeg Image|*.jpg;*.jpeg";
sfd.Title = "保存图片";
sfd.FileName = fileName;
if (sfd.ShowDialog() == DialogResult.OK)
{
try
{
pictureBox1.Image.Save(sfd.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
}
catch (Exception ex)
{
BaseMsgForm.ShowError(ex.Message);
}
}
}
private void pictureBox1_Click(object sender, EventArgs e)
{
if (imgDic != null && imgDic.Keys.Count > 0)
{
for (int i = 0; i < imgDic.Keys.ToList().Count; i++)
{
if (imgDic.Keys.ToList()[i] == currentImgUrl)
{
int index = i + 1;
if (index == imgDic.Keys.Count)
index = 0;
currentImgUrl = imgDic.Keys.ToList()[index];
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
break;
}
if (imgDic[imgDic.Keys.ToList()[i]] == currentImgUrl)
{
int index = i + 1;
if (index == imgDic.Keys.Count)
index = 0;
currentImgUrl = imgDic[imgDic.Keys.ToList()[index]];
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
break;
}
}
}
}
private void ShowImgForm_Load(object sender, EventArgs e)
{
label1.Visible = this.imgDic != null && this.imgDic.Keys.Count > 0;
}
}
}
File diff suppressed because it is too large. Load diff