*.[新增]新增函数IsEng来判断字符串是否是英文

This commit is contained in:
鑫Intel 2020-12-10 17:01:23 +08:00
parent 5084054674
commit b7075a3b55
42 changed files with 9886 additions and 9834 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,6 @@
### 2020-12-10更新
------
#### MyDbV4 V2.1.2012.1001
- *.[新增]新增函数IsEng来判断字符串是否是英文

View File

@ -1,146 +1,146 @@
using Itrycn_Project;
using ryCommon;
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 Itrycn_Project2
{
public partial class FrmStart : Form
{
string[] prog_args;
public FrmStart(string[] args)
{
InitializeComponent();
prog_args = args;
//配置软件信息
notifyIcon1.Text = Soft_Info.Soft_Title;
Text = Soft_Info.Soft_Title + " V" + RySoft.VersionStr;
if (!Soft_Info.ShowTray) { notifyIcon1.Visible = false; }
if (!Soft_Info.DonateVisabled) { ToolStripMenuItem.Text = "关于"; }
if (Soft_Info.Soft_Url.Length == 0) { ToolStripMenuItem.PerformClick(); }
notifyIcon1.Icon = Icon;
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Normal;
var topmost = this.TopMost;
this.TopMost = true;
this.Show();
this.TopMost = topmost;
}
private void 退ToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void FrmStart_Shown(object sender, EventArgs e)
{
ryCommon.Ini ini = new Ini(Soft_Info.UserDataFolder + "\\Win.dat");
ini.WriteIni(Soft_Info.Soft_Id, "hwnd", Handle.ToInt32());
if (prog_args.Length >= 1)
{
//如果是自启动,并且开启了右下角托盘图标,则隐藏自身。
if (prog_args[0] == Soft_Info.Soft_Pram && Soft_Info.ShowTray)
this.Hide();
}
}
private void FrmStart_FormClosing(object sender, FormClosingEventArgs e)
{
if (Soft_Info.ShowTray && Soft_Config.HideByCloseBtn && e.CloseReason== CloseReason.UserClosing)
{
e.Cancel = true;
this.Hide();
notifyIcon1.ShowBalloonTip(3000, Soft_Info.Soft_Title, "软件已经最小化到此处,请右击托盘图标进行关闭。", ToolTipIcon.Info);
return;
}
if (!Soft_Config.IsCanCloseForm)
{
e.Cancel = true;
MessageBox.Show("当前还有操作正在运行,请稍后关闭软件。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
protected override void WndProc(ref System.Windows.Forms.Message msg)
{
switch (msg.Msg)
{
case 17189: //处理消息
{
#region
switch (msg.WParam.ToInt32())
{
case 100://
#region
if ((int)msg.LParam.ToInt32() == 100)
{
this.Show();
this.WindowState = FormWindowState.Normal;
this.Top = (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2;
this.Left = (Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2;
//RyForm.SetActiveWindow(Handle);
RyForm.BringToTop(Handle);
ToolStripMenuItem.PerformClick();
this.BringToFront();
this.Select();
this.Focus();
RyForm.BringToTop(Handle);
}
#endregion
break;
}
#endregion
}
break;
default:
base.WndProc(ref msg);//调用基类函数处理非自定义消息。
break;
}
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (Soft_Info.DonateVisabled)
{
FrmAbout frm = new FrmAbout();
frm.ShowDialog();
frm.Dispose();
}
else
{
MessageBox.Show(Soft_Info.AboutText.Replace("#softname#", Soft_Info.Soft_Title).Replace("#ver#", "V" + RySoft.VersionStr), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
ryCommon.RyFiles.OpenUrl(Soft_Info.Soft_Url);
}
private void FrmStart_Load(object sender, EventArgs e)
{
Itrycn_Project.Itrycn_Db.CreateTable();
LiveUpdate.RyUpdate update = new LiveUpdate.RyUpdate(Soft_Info.Update_Url);
update.CheckUpdate();
var dbver = Itrycn_Db.GetDbVer();
using Itrycn_Project;
using ryCommon;
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 Itrycn_Project2
{
public partial class FrmStart : Form
{
string[] prog_args;
public FrmStart(string[] args)
{
InitializeComponent();
prog_args = args;
//配置软件信息
notifyIcon1.Text = Soft_Info.Soft_Title;
Text = Soft_Info.Soft_Title + " V" + RySoft.VersionStr;
if (!Soft_Info.ShowTray) { notifyIcon1.Visible = false; }
if (!Soft_Info.DonateVisabled) { ToolStripMenuItem.Text = "关于"; }
if (Soft_Info.Soft_Url.Length == 0) { ToolStripMenuItem.PerformClick(); }
notifyIcon1.Icon = Icon;
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Normal;
var topmost = this.TopMost;
this.TopMost = true;
this.Show();
this.TopMost = topmost;
}
private void 退ToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void FrmStart_Shown(object sender, EventArgs e)
{
ryCommon.Ini ini = new Ini(Soft_Info.UserDataFolder + "\\Win.dat");
ini.WriteIni(Soft_Info.Soft_Id, "hwnd", Handle.ToInt32());
if (prog_args.Length >= 1)
{
//如果是自启动,并且开启了右下角托盘图标,则隐藏自身。
if (prog_args[0] == Soft_Info.Soft_Pram && Soft_Info.ShowTray)
this.Hide();
}
}
private void FrmStart_FormClosing(object sender, FormClosingEventArgs e)
{
if (Soft_Info.ShowTray && Soft_Config.HideByCloseBtn && e.CloseReason== CloseReason.UserClosing)
{
e.Cancel = true;
this.Hide();
notifyIcon1.ShowBalloonTip(3000, Soft_Info.Soft_Title, "软件已经最小化到此处,请右击托盘图标进行关闭。", ToolTipIcon.Info);
return;
}
if (!Soft_Config.IsCanCloseForm)
{
e.Cancel = true;
MessageBox.Show("当前还有操作正在运行,请稍后关闭软件。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
protected override void WndProc(ref System.Windows.Forms.Message msg)
{
switch (msg.Msg)
{
case 17189: //处理消息
{
#region
switch (msg.WParam.ToInt32())
{
case 100://
#region
if ((int)msg.LParam.ToInt32() == 100)
{
this.Show();
this.WindowState = FormWindowState.Normal;
this.Top = (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2;
this.Left = (Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2;
//RyForm.SetActiveWindow(Handle);
RyForm.BringToTop(Handle);
ToolStripMenuItem.PerformClick();
this.BringToFront();
this.Select();
this.Focus();
RyForm.BringToTop(Handle);
}
#endregion
break;
}
#endregion
}
break;
default:
base.WndProc(ref msg);//调用基类函数处理非自定义消息。
break;
}
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (Soft_Info.DonateVisabled)
{
FrmAbout frm = new FrmAbout();
frm.ShowDialog();
frm.Dispose();
}
else
{
MessageBox.Show(Soft_Info.AboutText.Replace("#softname#", Soft_Info.Soft_Title).Replace("#ver#", "V" + RySoft.VersionStr), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
ryCommon.RyFiles.OpenUrl(Soft_Info.Soft_Url);
}
private void FrmStart_Load(object sender, EventArgs e)
{
Itrycn_Project.Itrycn_Db.CreateTable();
LiveUpdate.RyUpdate update = new LiveUpdate.RyUpdate(Soft_Info.Update_Url);
update.CheckUpdate();
var dbver = Itrycn_Db.GetDbVer();
if(dbver==1) //初始版本,并是当前要求的数据库
{
}
}
else
{
MessageBox.Show("不支持当前数据库版本,这可能是以下原因导致的:\r\n1.数据库已损坏;'\r\n2.当前数据库是由新版软件创建的(请更新软件后重试)。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
Application.Exit();
return;
}
}
}
}
Application.Exit();
return;
}
}
}
}

View File

@ -280,6 +280,15 @@ namespace ryCommon
return !Regex.IsMatch(str, "[^0-9a-zA-Z]");
}
/// <summary>
/// 判断字符串是否只包含英文
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static bool IsEng(string str)
{
return !Regex.IsMatch(str, "[^a-zA-Z]");
}
/// <summary>
/// 判断字符串是否匹配,支持?*通配符
/// </summary>
/// <param name="str">待匹配的字符串</param>

View File

@ -96,6 +96,15 @@ namespace ryCommon
return Strings.IsEngOrNum(input);
}
/// <summary>
/// 判断字符串是否是英文
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
static public bool IsEng(this string input)
{
return Strings.IsEng(input);
}
/// <summary>
/// 是否在指定范围内
/// </summary>
/// <param name="input"></param>

View File

@ -1,36 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("MyDb")]
[assembly: AssemblyDescription("基于乘黄V1架构")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("睿元网络工作室")]
[assembly: AssemblyProduct("MyDb")]
[assembly: AssemblyCopyright("Copyright © 2010-2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("9df20d86-a56e-4cf6-a3d8-f30421297b1b")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.1.2011.0901")]
[assembly: AssemblyFileVersion("2.1.2011.0901")]
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("MyDb")]
[assembly: AssemblyDescription("基于乘黄V1架构")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("睿元网络工作室")]
[assembly: AssemblyProduct("MyDb")]
[assembly: AssemblyCopyright("Copyright © 2010-2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("9df20d86-a56e-4cf6-a3d8-f30421297b1b")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.1.2012.1001")]
[assembly: AssemblyFileVersion("2.1.2012.1001")]

Binary file not shown.

Binary file not shown.