Commit f9899a86 authored by 247321453's avatar 247321453

1.3.1.0

parent 0de6f17a
...@@ -18,7 +18,8 @@ namespace DataEditorX ...@@ -18,7 +18,8 @@ namespace DataEditorX
/// </summary> /// </summary>
public class CheckUpdate public class CheckUpdate
{ {
static string HEAD="[DataEditorX]"; static string URL="";
static string HEAD="[DataEditorX]",HEAD2="[URL]";
public static void UpdateTip(string VERURL) public static void UpdateTip(string VERURL)
{ {
string newver=Check(VERURL); string newver=Check(VERURL);
...@@ -31,7 +32,10 @@ public static void UpdateTip(string VERURL) ...@@ -31,7 +32,10 @@ public static void UpdateTip(string VERURL)
MyMsg.GetString("have a new version.{0}version:{1}"), MyMsg.GetString("have a new version.{0}version:{1}"),
"\n",newver))) "\n",newver)))
{ {
System.Diagnostics.Process.Start(VERURL); if(DownLoad(URL,Path.Combine(Application.StartupPath, newver+".update.zip"),null))
{
MyMsg.Show("Download succeed.");
}
} }
} }
else if(iver2>0) else if(iver2>0)
...@@ -53,6 +57,12 @@ public static string Check(string VERURL) ...@@ -53,6 +57,12 @@ public static string Check(string VERURL)
{ {
urlver=html.Substring(t+HEAD.Length,w-t-HEAD.Length); urlver=html.Substring(t+HEAD.Length,w-t-HEAD.Length);
} }
t=html.IndexOf(HEAD2);
w=(t>0)?html.IndexOf(HEAD2,t+HEAD2.Length):0;
if(w>0)
{
URL=html.Substring(t+HEAD2.Length,w-t-HEAD2.Length);
}
} }
return urlver; return urlver;
} }
...@@ -88,5 +98,42 @@ public static string GetHtmlContentByUrl(string url) ...@@ -88,5 +98,42 @@ public static string GetHtmlContentByUrl(string url)
return ""; return "";
} }
#endregion #endregion
public static bool DownLoad(string URL,string filename,System.Windows.Forms.ProgressBar prog)
{
try
{
HttpWebRequest Myrq = (HttpWebRequest)System.Net.HttpWebRequest.Create(URL);
HttpWebResponse myrp = (HttpWebResponse)Myrq.GetResponse();
long totalBytes = myrp.ContentLength;
if (prog != null)
{
prog.Maximum = (int)totalBytes;
}
System.IO.Stream st = myrp.GetResponseStream();
System.IO.Stream so = new System.IO.FileStream(filename, System.IO.FileMode.Create);
long totalDownloadedByte = 0;
byte[] by = new byte[1024];
int osize = st.Read(by, 0, (int)by.Length);
while (osize > 0)
{
totalDownloadedByte = osize + totalDownloadedByte;
System.Windows.Forms.Application.DoEvents();
so.Write(by, 0, osize);
if (prog != null)
{
prog.Value = (int)totalDownloadedByte;
}
osize = st.Read(by, 0, (int)by.Length);
}
so.Close();
st.Close();
}
catch (System.Exception)
{
return false;
}
return true;
}
} }
} }
...@@ -103,12 +103,12 @@ void DataEditFormLoad(object sender, EventArgs e) ...@@ -103,12 +103,12 @@ void DataEditFormLoad(object sender, EventArgs e)
void InitString() void InitString()
{ {
btn_add.Text=MyMsg.GetString("Add")+"(&A)"; btn_add.Text=MyMsg.GetString("Add");
btn_serach.Text=MyMsg.GetString("Search")+"(&S)"; btn_serach.Text=MyMsg.GetString("Search");
btn_reset.Text=MyMsg.GetString("Reset")+"(&R)"; btn_reset.Text=MyMsg.GetString("Reset");
btn_del.Text=MyMsg.GetString("Delete")+"(&D)"; btn_del.Text=MyMsg.GetString("Delete");
btn_mod.Text=MyMsg.GetString("Modify")+"(&M)"; btn_mod.Text=MyMsg.GetString("Modify");
btn_lua.Text=MyMsg.GetString("Lua Script")+"(&L)"; btn_lua.Text=MyMsg.GetString("Lua Script");
lb_cardalias.Text= MyMsg.GetString("Alias Card"); lb_cardalias.Text= MyMsg.GetString("Alias Card");
lb_cardcode.Text=MyMsg.GetString("Card Code"); lb_cardcode.Text=MyMsg.GetString("Card Code");
...@@ -116,16 +116,16 @@ void InitString() ...@@ -116,16 +116,16 @@ void InitString()
lb_categorys.Text=MyMsg.GetString("Card Categorys"); lb_categorys.Text=MyMsg.GetString("Card Categorys");
lb_tiptexts.Text=MyMsg.GetString("Tips Texts"); lb_tiptexts.Text=MyMsg.GetString("Tips Texts");
menuitem_help.Text=MyMsg.GetString("Help")+"(&H)"; menuitem_help.Text=MyMsg.GetString("Help");
menuitem_about.Text=MyMsg.GetString("About"); menuitem_about.Text=MyMsg.GetString("About");
menuitem_checkupdate.Text=MyMsg.GetString("Check Update"); menuitem_checkupdate.Text=MyMsg.GetString("Check Update");
menuitem_github.Text=MyMsg.GetString("Source"); menuitem_github.Text=MyMsg.GetString("Source");
menuitem_file.Text=MyMsg.GetString("File")+"(&F)"; menuitem_file.Text=MyMsg.GetString("File");
menuitem_open.Text=MyMsg.GetString("Open Database")+"(&O)"; menuitem_open.Text=MyMsg.GetString("Open Database");
menuitem_new.Text=MyMsg.GetString("New Database")+"(&N)"; menuitem_new.Text=MyMsg.GetString("New Database");
menuitem_readydk.Text=MyMsg.GetString("Cards Form ydk file")+"(&Y)"; menuitem_readydk.Text=MyMsg.GetString("Cards Form ydk file");
menuitem_readimages.Text=MyMsg.GetString("Cards From Images")+"(&I)"; menuitem_readimages.Text=MyMsg.GetString("Cards From Images");
menuitem_copyselectto.Text=MyMsg.GetString("Select Copy To"); menuitem_copyselectto.Text=MyMsg.GetString("Select Copy To");
menuitem_copyto.Text=MyMsg.GetString("All Now Copy To"); menuitem_copyto.Text=MyMsg.GetString("All Now Copy To");
menuitem_quit.Text=MyMsg.GetString("Quit"); menuitem_quit.Text=MyMsg.GetString("Quit");
......
...@@ -18,7 +18,7 @@ namespace DataEditorX ...@@ -18,7 +18,7 @@ namespace DataEditorX
/// 消息 /// 消息
/// </summary> /// </summary>
public static class MyMsg public static class MyMsg
{ {
static Dictionary<string ,string> strDic=new Dictionary<string,string>(); static Dictionary<string ,string> strDic=new Dictionary<string,string>();
public static bool Init(string file) public static bool Init(string file)
{ {
...@@ -35,10 +35,13 @@ public static bool Init(string file) ...@@ -35,10 +35,13 @@ public static bool Init(string file)
if(!string.IsNullOrEmpty(line)&&!line.StartsWith("!")) if(!string.IsNullOrEmpty(line)&&!line.StartsWith("!"))
{ {
int l=line.IndexOf(" "); int l=line.IndexOf(" ");
k=line.Substring(0,l); if(l>0)
v=line.Substring(l+1); {
if(!strDic.ContainsKey(k)) k=line.Substring(0,l);
strDic.Add(k,v); v=line.Substring(l+1);
if(!strDic.ContainsKey(k))
strDic.Add(k,v);
}
} }
} }
sr.Close(); sr.Close();
...@@ -47,7 +50,7 @@ public static bool Init(string file) ...@@ -47,7 +50,7 @@ public static bool Init(string file)
return true; return true;
} }
public static string GetString(string keyStr) public static string GetString(string keyStr)
{ {
//string str=ConfigurationManager.AppSettings[keyStr]; //string str=ConfigurationManager.AppSettings[keyStr];
string str=keyStr; string str=keyStr;
if(strDic.ContainsKey(keyStr)) if(strDic.ContainsKey(keyStr))
......
...@@ -28,4 +28,4 @@ ...@@ -28,4 +28,4 @@
// //
// You can specify all the values or you can use the default the Revision and // You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below: // Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.3.0.1")] [assembly: AssemblyVersion("1.3.1.0")]
...@@ -13,6 +13,6 @@ ...@@ -13,6 +13,6 @@
<add key="language" value="chs" /> <add key="language" value="chs" />
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" /> <add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
<add key="updateURL" value="http://hi.baidu.com/247321453" /> <add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32" />
</appSettings> </appSettings>
</configuration> </configuration>
...@@ -18,12 +18,12 @@ Card Types 卡片种类 ...@@ -18,12 +18,12 @@ Card Types 卡片种类
Card Categorys 效果种类 Card Categorys 效果种类
Tips Texts 提示文字 Tips Texts 提示文字
Help 帮助 Help 帮助(&H)
About 关于 About 关于
Check Update 检查更新 Check Update 检查更新
Source 源码主页 Source 源码主页
File 文件 File 文件(&F)
Card Name 卡片名称 Card Name 卡片名称
Open Database 打开 Open Database 打开
...@@ -37,7 +37,8 @@ Quit 退出 ...@@ -37,7 +37,8 @@ Quit 退出
Is Last Version.{0}Version:{1} 已经是最新版本!{0}版本号:{1} Is Last Version.{0}Version:{1} 已经是最新版本!{0}版本号:{1}
Check update fail! 查询失败! Check update fail! 查询失败!
have a new version.{0}version:{1} 发现一个新版本。{0}版本号{1} have a new version.{0}version:{1} 发现一个新版本。是否下载?{0}版本号{1}
Download succeed. 下载成功。
Please select a DataBase! 请打开一个数据库! Please select a DataBase! 请打开一个数据库!
File is not exists! 文件不存在! File is not exists! 文件不存在!
......
...@@ -38,6 +38,7 @@ Quit Quit ...@@ -38,6 +38,7 @@ Quit Quit
Is Last Version.{0}Version:{1} Is Last Version.{0}Version:{1} Is Last Version.{0}Version:{1} Is Last Version.{0}Version:{1}
Check update fail! check update fail Check update fail! check update fail
have a new version.{0}version:{1} have a new version.{0}version:{1} have a new version.{0}version:{1} have a new version.{0}version:{1}
Download succeed. Download succeed.
Please select a DataBase! Please select a DataBase! Please select a DataBase! Please select a DataBase!
File is not exists! File is not exists! File is not exists! File is not exists!
......
[DataEditorX]1.3.0.1[DataEditorX] [DataEditorX]1.3.2.0[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★卡片复制: ★卡片复制:
替换复制:如果存在卡片,就用最新的替换 替换复制:如果存在卡片,就用最新的替换
不替换复制:如果存在卡片,就跳过 不替换复制:如果存在卡片,就跳过
......
No preview for this file type
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<!-- access these values via the property: <!-- access these values via the property:
System.Configuration.ConfigurationManager.AppSettings[key] System.Configuration.ConfigurationManager.AppSettings[key]
--> -->
<add key="language" value="en" /> <add key="language" value="chs" />
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" /> <add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
<add key="updateURL" value="http://hi.baidu.com/247321453" /> <add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32" />
</appSettings> </appSettings>
</configuration> </configuration>
...@@ -18,12 +18,12 @@ Card Types 卡片种类 ...@@ -18,12 +18,12 @@ Card Types 卡片种类
Card Categorys 效果种类 Card Categorys 效果种类
Tips Texts 提示文字 Tips Texts 提示文字
Help 帮助 Help 帮助(&H)
About 关于 About 关于
Check Update 检查更新 Check Update 检查更新
Source 源码主页 Source 源码主页
File 文件 File 文件(&F)
Card Name 卡片名称 Card Name 卡片名称
Open Database 打开 Open Database 打开
...@@ -37,7 +37,8 @@ Quit 退出 ...@@ -37,7 +37,8 @@ Quit 退出
Is Last Version.{0}Version:{1} 已经是最新版本!{0}版本号:{1} Is Last Version.{0}Version:{1} 已经是最新版本!{0}版本号:{1}
Check update fail! 查询失败! Check update fail! 查询失败!
have a new version.{0}version:{1} 发现一个新版本。{0}版本号{1} have a new version.{0}version:{1} 发现一个新版本。是否下载?{0}版本号{1}
Download succeed. 下载成功。
Please select a DataBase! 请打开一个数据库! Please select a DataBase! 请打开一个数据库!
File is not exists! 文件不存在! File is not exists! 文件不存在!
......
...@@ -38,6 +38,7 @@ Quit Quit ...@@ -38,6 +38,7 @@ Quit Quit
Is Last Version.{0}Version:{1} Is Last Version.{0}Version:{1} Is Last Version.{0}Version:{1} Is Last Version.{0}Version:{1}
Check update fail! check update fail Check update fail! check update fail
have a new version.{0}version:{1} have a new version.{0}version:{1} have a new version.{0}version:{1} have a new version.{0}version:{1}
Download succeed. Download succeed.
Please select a DataBase! Please select a DataBase! Please select a DataBase! Please select a DataBase!
File is not exists! File is not exists! File is not exists! File is not exists!
......
[DataEditorX]1.3.0.1[DataEditorX] [DataEditorX]1.3.2.0[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★卡片复制: ★卡片复制:
替换复制:如果存在卡片,就用最新的替换 替换复制:如果存在卡片,就用最新的替换
不替换复制:如果存在卡片,就跳过 不替换复制:如果存在卡片,就跳过
......
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment