Skip to content

Commit

Permalink
当休眠时间留空时,视为输入0
Browse files Browse the repository at this point in the history
  • Loading branch information
kenvix committed Jun 19, 2016
1 parent 92b5b7d commit b7c3fd8
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 4 deletions.
Binary file modified .vs/USBCopyer/v14/.suo
Binary file not shown.
15 changes: 15 additions & 0 deletions USBCopyer/Resources/EventViewer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<ViewerConfig>
<QueryConfig>
<QueryParams>
<UserQuery />
</QueryParams>
<QueryNode>
<Name LanguageNeutralValue="USBCopyer">USBCopyer</Name>
<QueryList>
<Query Id="0" Path="Application">
<Select Path="Application">*[System[Provider[@Name='USBCopyer'] and (Level=1 or Level=2 or Level=3 or Level=4 or Level=0 or Level=5)]]</Select>
</Query>
</QueryList>
</QueryNode>
</QueryConfig>
</ViewerConfig>
15 changes: 15 additions & 0 deletions USBCopyer/Resources/EventViewer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<ViewerConfig>
<QueryConfig>
<QueryParams>
<UserQuery />
</QueryParams>
<QueryNode>
<Name LanguageNeutralValue="USBCopyer">USBCopyer</Name>
<QueryList>
<Query Id="0" Path="Application">
<Select Path="Application">*[System[Provider[@Name='USBCopyer'] and (Level=1 or Level=2 or Level=3 or Level=4 or Level=0 or Level=5)]]</Select>
</Query>
</QueryList>
</QueryNode>
</QueryConfig>
</ViewerConfig>
15 changes: 11 additions & 4 deletions USBCopyer/Setting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,17 @@ private void saveButton_Click(object sender, EventArgs e)
{
try
{
if(!IsInteger(sleep.Text))
if(string.IsNullOrEmpty(sleep.Text))
{
MessageBox.Show("延迟复制时间只能为正整数", "保存设置失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
sleep.Text = "0";
}
else
{
if (!IsInteger(sleep.Text))
{
MessageBox.Show("延迟复制时间只能为正整数", "保存设置失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
Properties.Settings.Default.dir = dir.Text;
Properties.Settings.Default.conflict = conflict.SelectedIndex;
Expand Down Expand Up @@ -99,7 +106,7 @@ public static bool IsInteger(string s)

private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if(MessageBox.Show("你可以在 \"开始菜单\"\"启动\" 文件夹创建本程序的快捷方式,然后程序就可以自动启动了。\r\n如果你想要以隐藏模式启动程序,请右键快捷方式,点击 属性,在 目标 后面加上 /hide,在 USBCopyer.exe 后加上 /hide 即可\r\n\r\n按 确定 打开 \"启动\" 目录,按 取消 返回", "开机启动帮助", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
if(MessageBox.Show("你可以在 \"开始菜单\"\"启动\" 文件夹创建本程序的快捷方式,然后程序就可以自动启动了。\r\n\r\n如果你想要以隐藏模式启动程序,请右键快捷方式,点击 属性,在 目标 后面加上 /hide,在 USBCopyer.exe 后加上 /hide 即可\r\n\r\n如果你启用了UAC并且因开机时无法获取管理员权限而导致程序无法启动,那么用添加计划任务的方法替代创建快捷方式的方法\r\n\r\n按 确定 打开 \"启动\" 目录,按 取消 返回", "开机启动帮助", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
{
try
{
Expand Down
Binary file modified USBCopyer/bin/Release/USBCopyer.exe
Binary file not shown.
Binary file modified USBCopyer/bin/Release/USBCopyer.pdb
Binary file not shown.
Binary file modified USBCopyer/obj/Release/USBCopyer.csproj.GenerateResource.Cache
Binary file not shown.
Binary file modified USBCopyer/obj/Release/USBCopyer.exe
Binary file not shown.
Binary file modified USBCopyer/obj/Release/USBCopyer.pdb
Binary file not shown.

0 comments on commit b7c3fd8

Please sign in to comment.