Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
DataEditorX
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
DataEditorX
Commits
e25d7aff
Commit
e25d7aff
authored
May 21, 2014
by
247321453
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
94a5187d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
24 deletions
+57
-24
DataEditorX/DataEditForm.cs
DataEditorX/DataEditForm.cs
+3
-5
DataEditorX/DataEditorX.csproj
DataEditorX/DataEditorX.csproj
+0
-3
DataEditorX/MyUpdate.cs
DataEditorX/MyUpdate.cs
+53
-14
DataEditorX/Properties/AssemblyInfo.cs
DataEditorX/Properties/AssemblyInfo.cs
+1
-1
DataEditorX/Update/Release.zip
DataEditorX/Update/Release.zip
+0
-0
DataEditorX/Update/version.txt
DataEditorX/Update/version.txt
+0
-1
No files found.
DataEditorX/DataEditForm.cs
View file @
e25d7aff
...
...
@@ -21,7 +21,8 @@ public partial class DataEditForm : Form
{
#
region
成员变量
string
GAMEPATH
,
PICPATH
,
LUAPTH
;
string
GITURL
=
"https://github.com/247321453/DataEcitorX"
;
readonly
string
GITURL
=
"https://github.com/247321453/DataEcitorX"
;
readonly
string
VERURL
=
"http://hi.baidu.com/247321453"
;
Card
oldCard
=
new
Card
(
0
);
Card
srcCard
=
new
Card
(
0
);
ImageForm
imgform
=
new
ImageForm
();
...
...
@@ -788,10 +789,7 @@ void Menuitem_aboutClick(object sender, EventArgs e)
void
Menuitem_checkupdateClick
(
object
sender
,
EventArgs
e
)
{
if
(
MyUpdate
.
CheckUpdate
())
{
MyUpdate
.
Download
();
}
MyUpdate
.
CheckUpdate
(
VERURL
);
}
void
Menuitem_githubClick
(
object
sender
,
EventArgs
e
)
{
...
...
DataEditorX/DataEditorX.csproj
View file @
e25d7aff
...
...
@@ -71,7 +71,6 @@
<ItemGroup>
<Folder
Include=
"Data"
/>
<Folder
Include=
"Core"
/>
<Folder
Include=
"Update"
/>
</ItemGroup>
<ItemGroup>
<None
Include=
"Data\card-attribute.txt"
>
...
...
@@ -104,8 +103,6 @@
<None
Include=
"readme.txt"
>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</None>
<None
Include=
"Update\Release.zip"
/>
<None
Include=
"Update\version.txt"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
</Project>
\ No newline at end of file
DataEditorX/MyUpdate.cs
View file @
e25d7aff
...
...
@@ -18,30 +18,69 @@ namespace DataEditorX
/// </summary>
public
static
class
MyUpdate
{
static
readonly
string
VERURL
=
"https://github.com/247321453/DataEditorX/raw/master/DataEditorX/Update/version.txt"
;
static
readonly
string
DOWNURL
=
"https://github.com/247321453/DataEditorX/raw/master/DataEditorX/Update/Release.zip"
;
public
static
bool
CheckUpdate
()
static
string
downloadURL
=
""
;
static
string
Head
=
"[DataEditorX]"
;
static
string
Vhead
=
"v"
;
static
string
Thead
=
"t"
;
static
string
Dhead
=
"d"
;
public
static
bool
CheckUpdate
(
string
url
)
{
string
ver
,
lasttime
;
int
l
=-
1
;
string
html
=
GetHtmlContentByUrl
(
VERURL
);
string
ver
,
lasttime
,
verurl
;
int
t
,
w
;
string
html
=
GetHtmlContentByUrl
(
url
);
if
(
string
.
IsNullOrEmpty
(
html
))
{
MyMsg
.
Error
(
"无法获取版本!"
);
return
false
;
}
l
=
html
.
IndexOf
(
" time:"
);
ver
=(
l
>=
0
)?
html
.
Substring
(
4
,
l
):
"?.?.?.?"
;
lasttime
=(
l
>=
0
)?
html
.
Substring
(
l
):
"????-??-?? ??:??"
;
t
=
html
.
IndexOf
(
Head
);
w
=(
t
>=
0
)?
html
.
IndexOf
(
Head
,
t
+
1
):
0
;
if
(
w
<=
0
)
{
MyMsg
.
Error
(
"无法解释网址内容!\n"
+
url
);
return
false
;
}
verurl
=
html
.
Substring
(
t
+
Head
.
Length
,
w
-
t
-
Head
.
Length
);
if
(!
verurl
.
StartsWith
(
"http://"
,
StringComparison
.
OrdinalIgnoreCase
))
verurl
=
"http://"
+
verurl
;
#
if
DEBUG
MyMsg
.
Show
(
verurl
);
#
endif
html
=
GetHtmlContentByUrl
(
verurl
);
if
(
string
.
IsNullOrEmpty
(
html
))
{
MyMsg
.
Error
(
"无法解释网址内容!\n"
+
verurl
);
return
false
;
}
w
=
0
;
t
=
html
.
IndexOf
(
"<"
+
Vhead
+
">"
,
w
);
w
=(
t
>=
0
)?
html
.
IndexOf
(
"<"
+
Vhead
+
">"
,
t
+
1
):
0
;
ver
=(
w
>
0
)?
html
.
Substring
(
t
+
Vhead
.
Length
+
2
,
w
-
t
-
Vhead
.
Length
-
2
):
"?.?.?.?"
;
t
=
html
.
IndexOf
(
"<"
+
Thead
+
">"
,
w
);
w
=(
t
>=
0
)?
html
.
IndexOf
(
"<"
+
Thead
+
">"
,
t
+
1
):
0
;
lasttime
=(
w
>
0
)?
html
.
Substring
(
t
+
Thead
.
Length
+
2
,
w
-
t
-
Thead
.
Length
-
2
):
"????-??-?? ??:??"
;
t
=
html
.
IndexOf
(
"<"
+
Dhead
+
">"
,
w
);
w
=(
t
>=
0
)?
html
.
IndexOf
(
"<"
+
Dhead
+
">"
,
t
+
1
):
0
;
downloadURL
=(
w
>
0
)?
html
.
Substring
(
t
+
Dhead
.
Length
+
2
,
w
-
t
-
Dhead
.
Length
-
2
):
""
;
if
(!
string
.
IsNullOrEmpty
(
downloadURL
))
{
downloadURL
=
downloadURL
.
Replace
(
" http://"
,
"\nhttp://"
);
Clipboard
.
SetText
(
downloadURL
);
}
MyMsg
.
Show
(
"当前版本:"
+
Application
.
ProductVersion
+
"\n最新版本:"
+
ver
+
"\n最后更新时间:"
+
lasttime
);
+
"\n最后更新时间:"
+
lasttime
+
"\n下载地址:(已经复制到粘贴板)\n"
+
downloadURL
);
return
false
;
}
public
static
void
Download
()
{
}
/// <summary>
///根据url获取网站html内容 /// </summary>
...
...
DataEditorX/Properties/AssemblyInfo.cs
View file @
e25d7aff
...
...
@@ -28,4 +28,4 @@
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[
assembly
:
AssemblyVersion
(
"1.
1.0.3
"
)]
[
assembly
:
AssemblyVersion
(
"1.
2.0.0
"
)]
DataEditorX/Update/Release.zip
deleted
100644 → 0
View file @
94a5187d
File deleted
DataEditorX/Update/version.txt
deleted
100644 → 0
View file @
94a5187d
ver:1.1.0.3 time:2014-5-21 10:00
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment