1 Star 2 Fork 0

轮回/vivo-tools-3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
AboutForm.cs 8.17 KB
一键复制 编辑 原始数据 按行查看 历史
轮回 提交于 2022-04-27 10:19 . 更新3.0.0
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Windows.Forms;
using Entites;
using Sunny.UI;
using vivo_tools_Libraries;
namespace vivo_tools_3
{
partial class AboutForm : UIForm
{
public AboutForm(v_Users users)
{
InitializeComponent();
this.Text = String.Format("关于 {0}", AssemblyTitle);
this.labelProductName.Text =string.Format("名称: {0}", AssemblyProduct);
this.labelVersion.Text = String.Format("版本: {0}", Application.ProductVersion);
if (File.Exists(@"path\_beta"))
{
this.labelProductName.Text += "[Beta";
string beta_text = File.ReadAllText(@"path\_beta");
if (beta_text != null && beta_text != "")
{
this.labelProductName.Text += beta_text + "]";
}
}
this.labelCopyright.Text = String.Format("版权: {0}", AssemblyCopyright);
this.labelCompanyName.Text = String.Format("作者: {0}", AssemblyCompany);
this.labelComputerName.Text = string.Format("Windows信息: {0}({1})",osv, Environment.MachineName);
this.labelSunnyUIVersion.Text = string.Format("SunnyUI版本: {0}", this.Version);
if (users != null && users.Uname != null && users.Uname != "")
{
this.labelUserName.Text = string.Format("当前登录用户: {0}", users.Uname);
if (users.IsAdmin == 1)
{
this.labelUserName.Text += "[管理员]";
}
if (users.Uimage.Length < 3)
{
this.pictureBox1.BackgroundImage = (Image)Properties.UsersImage.ResourceManager.GetObject(users.Uimage);
this.lb_uiamge.Visible = true;
}
else
{
byte[] imagebytes = users.Uimage.ToBase64Bytes();
MemoryStream ms = new MemoryStream(imagebytes, 0, imagebytes.Length);
ms.Write(imagebytes, 0, imagebytes.Length);
Image img = Image.FromStream(ms);
pictureBox1.BackgroundImage = img;
}
}
else
{
this.labelUserName.Text = "用户未登录";
this.lb_uiamge.Visible = false;
}
this.uiLinkLabel1.Text = "访问官网";
this.uiLinkLabel2.Text = "访问论坛";
this.uiLinkLabel3.Text = "反馈问题";
this.uiLinkLabel4.Text = "打赏作者";
this.uiLinkLabel2.Left = this.uiLinkLabel1.Left + this.uiLinkLabel1.Width;
this.uiLinkLabel3.Left = this.uiLinkLabel2.Left + this.uiLinkLabel2.Width;
this.uiLinkLabel4.Left = this.uiLinkLabel3.Left + this.uiLinkLabel3.Width;
}
#region 程序集特性访问器
/// <summary>
/// 获取到的Windows信息
/// </summary>
public string osv = Computer.GetOS_Version();
public string AssemblyTitle
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (titleAttribute.Title != "")
{
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
}
}
public string AssemblyDescription
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
}
}
public string AssemblyProduct
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyProductAttribute)attributes[0]).Product;
}
}
public string AssemblyCopyright
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}
public string AssemblyCompany
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCompanyAttribute)attributes[0]).Company;
}
}
#endregion
private void uiLinkLabel1_Click(object sender, EventArgs e)
{
//官网
Process.Start("https://vivo.adndczs.ml/");
}
private void uiLinkLabel2_Click(object sender, EventArgs e)
{
//论坛
Process.Start("https://adndczs.ml");
}
private void uiLinkLabel3_Click(object sender, EventArgs e)
{
//点击链接加入群聊【VIVO - Y51 - ROM / vivo Y51搞机工】:https://jq.qq.com/?_wv=1027&k=A4EepFpX
//点击链接加入群聊【VIVO - Y51 - ROM / vivo Y51搞机工】:https://jq.qq.com/?_wv=1027&k=6MFz9F7z
//Process.Start("https://jq.qq.com/?_wv=1027&k=6MFz9F7z");
MyBrowser_Form mf = new MyBrowser_Form("https://jq.qq.com/?_wv=1027&k=6MFz9F7z");
mf.Render();
mf.Style = Style;
mf.ShowDialog();
}
private void uiLinkLabel4_Click(object sender, EventArgs e)
{
RewardForm rf = new RewardForm();
rf.Render();
rf.Style = this.Style;
rf.ShowDialog();
}
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
ControlPaint.DrawBorder(e.Graphics,
this.pictureBox1.ClientRectangle,
Color.FromArgb(200, 200, 200, 200), //左
1,
ButtonBorderStyle.Solid,
Color.FromArgb(200, 200, 200, 200),//上
1,
ButtonBorderStyle.Solid,
Color.FromArgb(200, 200, 200, 200),//右
1,
ButtonBorderStyle.Solid,
Color.FromArgb(200, 200, 200, 200),//下
1,
ButtonBorderStyle.Solid);
}
private void AboutForm_UIStyleChanged(object sender, EventArgs e)
{
if (TitleColor.R * 0.299 + TitleColor.G * 0.578 + TitleColor.B * 0.114 >= 192)
{
this.TitleForeColor = Color.FromArgb(96, 98, 102);
this.ControlBoxForeColor = Color.FromArgb(96, 98, 102);
}
else
{
this.TitleForeColor = Color.White;
this.ControlBoxForeColor = Color.White;
}
this.rectColor = this.TitleColor;
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/PeopleCarWorld/vivo-tools-3.git
[email protected]:PeopleCarWorld/vivo-tools-3.git
PeopleCarWorld
vivo-tools-3
vivo-tools-3
master

搜索帮助