You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lj_plc/Main/Mesnac.Gui.Run/Dialog/FrmAbout.cs

74 lines
2.7 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ICSharpCode.Core;
using Mesnac.Core;
using System.Xml;
namespace Mesnac.Gui.Run.Dialog
{
public partial class FrmAbout : Form
{
public FrmAbout()
{
InitializeComponent();
}
/// <summary>
/// 界面元素初始化方法
/// </summary>
public void InitUIMethod()
{
this.Text = StringParser.Parse(ResourceService.GetString("Dialog_FrmAbout_Text")); //关于
this.btnOk.Text = StringParser.Parse(ResourceService.GetString("Dialog_Button_OK"));
}
private void FrmAbout_Load(object sender, EventArgs e)
{
this.InitUIMethod();
//string xmlFile = @"E:\配置库\Mix\01工程域\04系统实现\01上辅机上位机\SlnMix.VS2013\Main\MCRun\Data\SysConfig\About.xml";
string xmlFile = @"..\..\Data\SysConfig\About.xml";
XmlDocument xml = new XmlDocument();
//打开现有的一个xml文件
xml.Load(xmlFile);
//获得xml的根节点
XmlElement Config = xml.DocumentElement;
//从xml文件中读取数据
string lab1 = Config.SelectSingleNode("Product/Name").InnerText;
string lab2 = Config.SelectSingleNode("Product/Version").InnerText;
string lab3 = Config.SelectSingleNode("Product/PublishDate").InnerText;
string lab4 = Config.SelectSingleNode("Product/CopyRight").InnerText;
string lab5 = Config.SelectSingleNode("Product/SID").InnerText;
string lab6 = Config.SelectSingleNode("Product/URL").InnerText;
string lab7 = Config.SelectSingleNode("Product/Warning").InnerText;
string lab8 = Config.SelectSingleNode("Project/Name").InnerText;
this.label1.Text = lab1;
this.label2.Text = lab2;
this.label3.Text = lab3;
this.label4.Text = lab4;
this.label5.Text = lab5;
//this.label6.Text = lab6;
this.label7.Text = lab7;
this.label8.Text = lab8;
this.linkLabel1.Text = lab6;
}
private void btnOk_Click(object sender, EventArgs e)
{
this.DialogResult = System.Windows.Forms.DialogResult.OK;
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
linkLabel1.LinkVisited = true;
System.Diagnostics.Process.Start("http://www.mesnac.com/");
}
}
}