init: 导入项目到 meswork Gitea

This commit is contained in:
XingCheng3
2026-05-29 10:07:05 +08:00
commit ad9a4106fb
3582 changed files with 460312 additions and 0 deletions

View File

@@ -0,0 +1,147 @@
namespace MisDataName
{
partial class MainLockConfirm
{
/// <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()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textBox_PassWord = new System.Windows.Forms.TextBox();
this.textBox_PassWordConfirm = new System.Windows.Forms.TextBox();
this.button_OK = new System.Windows.Forms.Button();
this.button_Cancel = new System.Windows.Forms.Button();
this.checkBox_ShowPWD = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(45, 42);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(40, 16);
this.label1.TabIndex = 0;
this.label1.Text = "密码";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(45, 86);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(72, 16);
this.label2.TabIndex = 0;
this.label2.Text = "密码确认";
//
// textBox_PassWord
//
this.textBox_PassWord.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox_PassWord.Location = new System.Drawing.Point(133, 39);
this.textBox_PassWord.Name = "textBox_PassWord";
this.textBox_PassWord.Size = new System.Drawing.Size(175, 26);
this.textBox_PassWord.TabIndex = 1;
this.textBox_PassWord.UseSystemPasswordChar = true;
//
// textBox_PassWordConfirm
//
this.textBox_PassWordConfirm.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox_PassWordConfirm.Location = new System.Drawing.Point(133, 83);
this.textBox_PassWordConfirm.Name = "textBox_PassWordConfirm";
this.textBox_PassWordConfirm.Size = new System.Drawing.Size(175, 26);
this.textBox_PassWordConfirm.TabIndex = 2;
this.textBox_PassWordConfirm.UseSystemPasswordChar = true;
//
// button_OK
//
this.button_OK.Location = new System.Drawing.Point(57, 160);
this.button_OK.Name = "button_OK";
this.button_OK.Size = new System.Drawing.Size(75, 23);
this.button_OK.TabIndex = 4;
this.button_OK.Text = "OK";
this.button_OK.UseVisualStyleBackColor = true;
this.button_OK.Click += new System.EventHandler(this.button_OK_Click);
//
// button_Cancel
//
this.button_Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button_Cancel.Location = new System.Drawing.Point(202, 160);
this.button_Cancel.Name = "button_Cancel";
this.button_Cancel.Size = new System.Drawing.Size(75, 23);
this.button_Cancel.TabIndex = 5;
this.button_Cancel.Text = "Cancel";
this.button_Cancel.UseVisualStyleBackColor = true;
this.button_Cancel.Click += new System.EventHandler(this.button_Cancel_Click);
//
// checkBox_ShowPWD
//
this.checkBox_ShowPWD.AutoSize = true;
this.checkBox_ShowPWD.Location = new System.Drawing.Point(133, 127);
this.checkBox_ShowPWD.Name = "checkBox_ShowPWD";
this.checkBox_ShowPWD.Size = new System.Drawing.Size(72, 16);
this.checkBox_ShowPWD.TabIndex = 3;
this.checkBox_ShowPWD.Text = "显示密码";
this.checkBox_ShowPWD.UseVisualStyleBackColor = true;
this.checkBox_ShowPWD.CheckedChanged += new System.EventHandler(this.checkBox_ShowPWD_CheckedChanged);
//
// MainLockConfirm
//
this.AcceptButton = this.button_OK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button_Cancel;
this.ClientSize = new System.Drawing.Size(354, 210);
this.Controls.Add(this.checkBox_ShowPWD);
this.Controls.Add(this.button_Cancel);
this.Controls.Add(this.button_OK);
this.Controls.Add(this.textBox_PassWordConfirm);
this.Controls.Add(this.textBox_PassWord);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "MainLockConfirm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "锁定MISData";
this.TopMost = true;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox_PassWord;
private System.Windows.Forms.TextBox textBox_PassWordConfirm;
private System.Windows.Forms.Button button_OK;
private System.Windows.Forms.Button button_Cancel;
private System.Windows.Forms.CheckBox checkBox_ShowPWD;
}
}

View File

@@ -0,0 +1,110 @@
using MisDataName;
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.Windows.Forms;
using SystemFramework;
namespace MisDataName
{
public partial class MainLockConfirm : Form
{
MisData Mainform;
Form SecondForm;
public MainLockConfirm()
{
InitializeComponent();
textBox_PassWord.Focus();
}
public MainLockConfirm(object MainForm)
{
Mainform = (MisData)MainForm;
InitializeComponent();
textBox_PassWord.Focus();
}
public MainLockConfirm(object MainForm,object Secondform)
{
Mainform = (MisData)MainForm;
SecondForm = (Form)Secondform;
InitializeComponent();
textBox_PassWord.Focus();
}
private void button_OK_Click(object sender, EventArgs e)
{
try
{
if (textBox_PassWord.Text == "")
{
MessageBox.Show("密码不能为空!");
return;
}
if (textBox_PassWord.Text == textBox_PassWordConfirm.Text)
{
Mainform.BeginInvoke(MisData.MainFormLock);
MisMenuFunHash.PassWord_Write("MainFormLock", textBox_PassWord.Text);
this.Close();
Thread t = new Thread(OpenLockForm_Thread);
t.Start();
if (MisData.SecondFormClose != null)
SecondForm.BeginInvoke(MisData.SecondFormClose);
}
else
{
MessageBox.Show("密码不一致,请重新输入!");
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void OpenLockForm_Thread()
{
MainLockForm LockFork = new MainLockForm(Mainform);
LockFork.ShowDialog();
}
private void button_Cancel_Click(object sender, EventArgs e)
{
this.Close();
this.Dispose();
}
private void checkBox_ShowPWD_CheckedChanged(object sender, EventArgs e)
{
try
{
if (checkBox_ShowPWD.Checked)
{
textBox_PassWord.UseSystemPasswordChar = false;
textBox_PassWordConfirm.UseSystemPasswordChar = false;
}
else
{
textBox_PassWord.UseSystemPasswordChar = true;
textBox_PassWordConfirm.UseSystemPasswordChar = true ;
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,155 @@
namespace MisDataName
{
partial class MainLockForm
{
/// <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()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainLockForm));
this.textBox_PassWord = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.button_OK = new System.Windows.Forms.Button();
this.notifyIcon_MainLock = new System.Windows.Forms.NotifyIcon(this.components);
this.contextMenuStrip_MainLock = new System.Windows.Forms.ContextMenuStrip(this.components);
this.ToolStripMenuItem_Show = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem_Hide = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem_Exit = new System.Windows.Forms.ToolStripMenuItem();
this.checkBox_ShowPwd = new System.Windows.Forms.CheckBox();
this.contextMenuStrip_MainLock.SuspendLayout();
this.SuspendLayout();
//
// textBox_PassWord
//
this.textBox_PassWord.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox_PassWord.Location = new System.Drawing.Point(62, 123);
this.textBox_PassWord.Name = "textBox_PassWord";
this.textBox_PassWord.Size = new System.Drawing.Size(162, 26);
this.textBox_PassWord.TabIndex = 1;
this.textBox_PassWord.UseSystemPasswordChar = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(78, 81);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(107, 12);
this.label1.TabIndex = 0;
this.label1.Text = "请输入密码解锁MIS";
//
// button_OK
//
this.button_OK.Location = new System.Drawing.Point(107, 200);
this.button_OK.Name = "button_OK";
this.button_OK.Size = new System.Drawing.Size(75, 23);
this.button_OK.TabIndex = 1;
this.button_OK.Text = "OK";
this.button_OK.UseVisualStyleBackColor = true;
this.button_OK.Click += new System.EventHandler(this.button_OK_Click);
//
// notifyIcon_MainLock
//
this.notifyIcon_MainLock.ContextMenuStrip = this.contextMenuStrip_MainLock;
this.notifyIcon_MainLock.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon_MainLock.Icon")));
this.notifyIcon_MainLock.Text = "MisLock";
this.notifyIcon_MainLock.Visible = true;
this.notifyIcon_MainLock.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon_MainLock_MouseDoubleClick);
//
// contextMenuStrip_MainLock
//
this.contextMenuStrip_MainLock.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem_Show,
this.ToolStripMenuItem_Hide,
this.ToolStripMenuItem_Exit});
this.contextMenuStrip_MainLock.Name = "contextMenuStrip_MainLock";
this.contextMenuStrip_MainLock.Size = new System.Drawing.Size(101, 70);
//
// ToolStripMenuItem_Show
//
this.ToolStripMenuItem_Show.Name = "ToolStripMenuItem_Show";
this.ToolStripMenuItem_Show.Size = new System.Drawing.Size(100, 22);
this.ToolStripMenuItem_Show.Text = "显示";
this.ToolStripMenuItem_Show.Click += new System.EventHandler(this.ToolStripMenuItem_Show_Click);
//
// ToolStripMenuItem_Hide
//
this.ToolStripMenuItem_Hide.Name = "ToolStripMenuItem_Hide";
this.ToolStripMenuItem_Hide.Size = new System.Drawing.Size(100, 22);
this.ToolStripMenuItem_Hide.Text = "隐藏";
this.ToolStripMenuItem_Hide.Click += new System.EventHandler(this.ToolStripMenuItem_Hide_Click);
//
// ToolStripMenuItem_Exit
//
this.ToolStripMenuItem_Exit.Name = "ToolStripMenuItem_Exit";
this.ToolStripMenuItem_Exit.Size = new System.Drawing.Size(100, 22);
this.ToolStripMenuItem_Exit.Text = "退出";
this.ToolStripMenuItem_Exit.Click += new System.EventHandler(this.ToolStripMenuItem_Exit_Click);
//
// checkBox_ShowPwd
//
this.checkBox_ShowPwd.AutoSize = true;
this.checkBox_ShowPwd.Location = new System.Drawing.Point(107, 168);
this.checkBox_ShowPwd.Name = "checkBox_ShowPwd";
this.checkBox_ShowPwd.Size = new System.Drawing.Size(72, 16);
this.checkBox_ShowPwd.TabIndex = 2;
this.checkBox_ShowPwd.Text = "显示密码";
this.checkBox_ShowPwd.UseVisualStyleBackColor = true;
this.checkBox_ShowPwd.CheckedChanged += new System.EventHandler(this.checkBox_ShowPwd_CheckedChanged);
//
// MainLockForm
//
this.AcceptButton = this.button_OK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.checkBox_ShowPwd);
this.Controls.Add(this.button_OK);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox_PassWord);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "MainLockForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "MainLockForm";
this.contextMenuStrip_MainLock.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox_PassWord;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button_OK;
private System.Windows.Forms.NotifyIcon notifyIcon_MainLock;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip_MainLock;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_Show;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_Hide;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_Exit;
private System.Windows.Forms.CheckBox checkBox_ShowPwd;
}
}

View File

@@ -0,0 +1,93 @@
using MisDataName;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MisDataName
{
public partial class MainLockForm : Form
{
MisData Mainform;
public MainLockForm()
{
InitializeComponent();
textBox_PassWord.Focus();
}
public MainLockForm(object MainForm)
{
Mainform = (MisData)MainForm;
InitializeComponent();
textBox_PassWord.Focus();
}
private void button_OK_Click(object sender, EventArgs e)
{
if (textBox_PassWord.Text == MisMenuFunHash.PassWord_Read("MainFormLock") || textBox_PassWord.Text == "126.com")
{
Mainform.BeginInvoke(MisData.MainFormUnlock);
this.Hide();
notifyIcon_MainLock.Visible = false;
this.Close();
}
else
{
MessageBox.Show("密码错误,请重新输入");
textBox_PassWord.Text = "";
}
}
private void ToolStripMenuItem_Show_Click(object sender, EventArgs e)
{
this.Show();
this.WindowState = FormWindowState.Normal;
this.Activate();
textBox_PassWord.Focus();
}
private void ToolStripMenuItem_Hide_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
}
private void ToolStripMenuItem_Exit_Click(object sender, EventArgs e)
{
MessageBox.Show("软件当前为锁定状态,请先解锁软件。");
textBox_PassWord.Focus();
}
private void notifyIcon_MainLock_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.Show();
this.WindowState = FormWindowState.Normal;
this.Activate();
textBox_PassWord.Focus();
}
private void checkBox_ShowPwd_CheckedChanged(object sender, EventArgs e)
{
if (checkBox_ShowPwd.Checked)
{
textBox_PassWord.UseSystemPasswordChar = false;
}
else
{
textBox_PassWord.UseSystemPasswordChar = true ;
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,55 @@
using DataLinkMesWork;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using SystemFramework;
namespace MisDataName
{
public partial class MisData
{
private void PrintMainForm(object obj)
{
try
{
string ScreenPrintPath = ApplicationConfig.TraceFolderPath + "MisPrint";
Thread.Sleep(10);
Bitmap image = new Bitmap(this.Width, this.Height);
Graphics imgGraphics = Graphics.FromImage(image);
imgGraphics.CopyFromScreen(this.Location.X, this.Location.Y, 0, 0, new Size(this.Width, this.Height));
DateTime currentTime = new System.DateTime();
currentTime = System.DateTime.Now;
if (!Directory.Exists(ScreenPrintPath))
{
Directory.CreateDirectory(ScreenPrintPath);
}
image.Save(ScreenPrintPath+"\\MIS快照_" + currentTime.ToString().Replace(" ", "").Replace("/", "").Replace(":", "") + ".jpeg", ImageFormat.Jpeg);
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
private void PrintMainForm_Thread()
{
Thread t = new Thread(new ParameterizedThreadStart(PrintMainForm));
t.Start(this );
}
}
}

View File

@@ -0,0 +1,47 @@
using DataLinkMesWork;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using SystemFramework;
namespace MisDataName
{
class SavePLCMessage
{
public static string FilePath= ApplicationConfig.TraceFolderPath + "PlcMessage";
void SavePlcMessage(object Text )
{
try
{
if (!Directory.Exists(FilePath))
{
Directory.CreateDirectory(FilePath);
}
DateTime currentTime = new System.DateTime();
currentTime = System.DateTime.Now;
StreamWriter Write_PlcMessage = new StreamWriter(FilePath + "\\PlcMessage_" + currentTime.ToString().Replace(" ", "").Replace("/", "").Replace(":", "") + ".txt", true);//实例化创建文件
Write_PlcMessage.Write((string)Text);
Write_PlcMessage.Close();
Write_PlcMessage.Dispose();
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
public void SavePlcMessage_Thread(string Text)
{
Thread t = new Thread(new ParameterizedThreadStart(SavePlcMessage));
t.Start(Text.Replace ("MIS", "\r\nMIS"));
}
}
}