增加中英文和弹框提示

This commit is contained in:
chenjiangqun
2026-04-13 10:37:47 +08:00
parent 7835489846
commit 3482c32455
5 changed files with 283 additions and 19 deletions

View File

@@ -0,0 +1,99 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace WinISP.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resource_CN {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resource_CN() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WinISP.Properties.Resource-CN", typeof(Resource_CN).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// 查找类似 版本号错误 的本地化字符串。
/// </summary>
internal static string BoardNameErr {
get {
return ResourceManager.GetString("BoardNameErr", resourceCulture);
}
}
/// <summary>
/// 查找类似 芯片型号错误 的本地化字符串。
/// </summary>
internal static string ChipNameErr {
get {
return ResourceManager.GetString("ChipNameErr", resourceCulture);
}
}
/// <summary>
/// 查找类似 对比ModelName 失败! 的本地化字符串。
/// </summary>
internal static string ModelNameErr {
get {
return ResourceManager.GetString("ModelNameErr", resourceCulture);
}
}
/// <summary>
/// 查找类似 屏型号错误 的本地化字符串。
/// </summary>
internal static string PanelNameErr {
get {
return ResourceManager.GetString("PanelNameErr", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,123 @@
<?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>
<data name="ModelNameErr" xml:space="preserve">
<value>对比ModelName 失败!</value>
</data>
</root>

View File

@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // 此代码由工具生成。
// Runtime Version:4.0.30319.42000 // 运行时版本:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // 对此文件的更改可能会导致不正确的行为,并且如果
// the code is regenerated. // 重新生成代码,这些更改将会丢失。
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@@ -13,13 +13,13 @@ namespace WinISP.Properties {
/// <summary> /// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc. /// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary> /// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder // 此类是由 StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio. // 类通过类似于 ResGen Visual Studio 的工具自动生成的。
// To add or remove a member, edit your .ResX file then rerun ResGen // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// with the /str option, or rebuild your VS project. // (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
@@ -33,7 +33,7 @@ namespace WinISP.Properties {
} }
/// <summary> /// <summary>
/// Returns the cached ResourceManager instance used by this class. /// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager { internal static global::System.Resources.ResourceManager ResourceManager {
@@ -47,8 +47,8 @@ namespace WinISP.Properties {
} }
/// <summary> /// <summary>
/// Overrides the current thread's CurrentUICulture property for all /// 重写当前线程的 CurrentUICulture 属性,对
/// resource lookups using this strongly typed resource class. /// 使用此强类型资源类的所有资源查找执行重写。
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture { internal static global::System.Globalization.CultureInfo Culture {
@@ -59,5 +59,41 @@ namespace WinISP.Properties {
resourceCulture = value; resourceCulture = value;
} }
} }
/// <summary>
/// 查找类似 Compare BoardName Fail! 的本地化字符串。
/// </summary>
internal static string BoardNameErr {
get {
return ResourceManager.GetString("BoardNameErr", resourceCulture);
}
}
/// <summary>
/// 查找类似 Compare ChipName Fail! 的本地化字符串。
/// </summary>
internal static string ChipNameErr {
get {
return ResourceManager.GetString("ChipNameErr", resourceCulture);
}
}
/// <summary>
/// 查找类似 Compare ModelName Fail! 的本地化字符串。
/// </summary>
internal static string ModelNameErr {
get {
return ResourceManager.GetString("ModelNameErr", resourceCulture);
}
}
/// <summary>
/// 查找类似 Compare PanelName Fail! 的本地化字符串。
/// </summary>
internal static string PanelNameErr {
get {
return ResourceManager.GetString("PanelNameErr", resourceCulture);
}
}
} }
} }

View File

@@ -117,5 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="ModelNameErr" xml:space="preserve">
<value>Compare ModelName Fail!</value>
</data>
</root> </root>

View File

@@ -213,8 +213,12 @@ namespace WinISP
Application.DoEvents(); Application.DoEvents();
} }
private void SetISPStatus(bool isRunning) private void SetISPStatus(bool isRunning,string err = "")
{ {
if (!string.IsNullOrEmpty(err))
{
MessageBox.Show(err, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
_IsRunISP = isRunning; _IsRunISP = isRunning;
btnRunISP.Enabled = !isRunning; btnRunISP.Enabled = !isRunning;
btnOpenBin.Enabled = !isRunning; btnOpenBin.Enabled = !isRunning;
@@ -1212,25 +1216,25 @@ namespace WinISP
if (!IsModelNameMatch(_u8ModelName)) if (!IsModelNameMatch(_u8ModelName))
{ {
SetStatusMsg("modelname错误"); SetStatusMsg(Properties.Resources.ModelNameErr);
SetISPStatus(false); SetISPStatus(false);
return; return;
} }
if (!IsChipNameMatch(_u8ChipName)) if (!IsChipNameMatch(_u8ChipName))
{ {
SetStatusMsg("芯片型号错误"); SetStatusMsg(Properties.Resources.ChipNameErr);
SetISPStatus(false); SetISPStatus(false);
return; return;
} }
if (!IsPanelNameMatch(_u8PanelName)) if (!IsPanelNameMatch(_u8PanelName))
{ {
SetStatusMsg("屏型号错误"); SetStatusMsg(Properties.Resources.PanelNameErr);
SetISPStatus(false); SetISPStatus(false);
return; return;
} }
if (!IsBoardNameMatch(_u8BoardName)) if (!IsBoardNameMatch(_u8BoardName))
{ {
SetStatusMsg("版本号错误"); SetStatusMsg(Properties.Resources.BoardNameErr);
SetISPStatus(false); SetISPStatus(false);
return; return;
} }