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
9217edf9
Commit
9217edf9
authored
May 21, 2014
by
247321453
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
737b767a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
107 additions
and
34 deletions
+107
-34
DataEditorX/Data/ygopro.txt
DataEditorX/Data/ygopro.txt
+1
-0
DataEditorX/DataEditForm.Designer.cs
DataEditorX/DataEditForm.Designer.cs
+4
-4
DataEditorX/DataEditForm.cs
DataEditorX/DataEditForm.cs
+15
-18
DataEditorX/DataEditorX.csproj
DataEditorX/DataEditorX.csproj
+4
-3
DataEditorX/DataEditorX.txt
DataEditorX/DataEditorX.txt
+0
-3
DataEditorX/MyUpdate.cs
DataEditorX/MyUpdate.cs
+79
-0
DataEditorX/Update/version.txt
DataEditorX/Update/version.txt
+1
-2
DataEditorX/readme.txt
DataEditorX/readme.txt
+3
-4
No files found.
DataEditorX/Data/ygopro.txt
0 → 100644
View file @
9217edf9
F:\game\YGOPRO
\ No newline at end of file
DataEditorX/DataEditForm.Designer.cs
View file @
9217edf9
...
...
@@ -222,21 +222,21 @@ private void InitializeComponent()
//
this
.
menuitem_about
.
Name
=
"menuitem_about"
;
this
.
menuitem_about
.
ShortcutKeys
=
System
.
Windows
.
Forms
.
Keys
.
F1
;
this
.
menuitem_about
.
Size
=
new
System
.
Drawing
.
Size
(
1
36
,
22
);
this
.
menuitem_about
.
Size
=
new
System
.
Drawing
.
Size
(
1
52
,
22
);
this
.
menuitem_about
.
Text
=
"关于"
;
this
.
menuitem_about
.
Click
+=
new
System
.
EventHandler
(
this
.
Menuitem_aboutClick
);
//
// menuitem_checkupdate
//
this
.
menuitem_checkupdate
.
Name
=
"menuitem_checkupdate"
;
this
.
menuitem_checkupdate
.
Size
=
new
System
.
Drawing
.
Size
(
1
36
,
22
);
this
.
menuitem_checkupdate
.
Text
=
"
下载新版本
"
;
this
.
menuitem_checkupdate
.
Size
=
new
System
.
Drawing
.
Size
(
1
52
,
22
);
this
.
menuitem_checkupdate
.
Text
=
"
检查更新
"
;
this
.
menuitem_checkupdate
.
Click
+=
new
System
.
EventHandler
(
this
.
Menuitem_checkupdateClick
);
//
// menuitem_github
//
this
.
menuitem_github
.
Name
=
"menuitem_github"
;
this
.
menuitem_github
.
Size
=
new
System
.
Drawing
.
Size
(
1
36
,
22
);
this
.
menuitem_github
.
Size
=
new
System
.
Drawing
.
Size
(
1
52
,
22
);
this
.
menuitem_github
.
Text
=
"程序源码"
;
this
.
menuitem_github
.
Click
+=
new
System
.
EventHandler
(
this
.
Menuitem_githubClick
);
//
...
...
DataEditorX/DataEditForm.cs
View file @
9217edf9
...
...
@@ -20,7 +20,8 @@ namespace DataEditorX
public
partial
class
DataEditForm
:
Form
{
#
region
成员变量
string
GAMEPATH
,
PICPATH
,
UPDATEURL
,
GITURL
,
LUAPTH
,
INIPATH
;
string
GAMEPATH
,
PICPATH
,
LUAPTH
;
string
GITURL
=
"https://github.com/247321453/DataEcitorX"
;
Card
oldCard
=
new
Card
(
0
);
Card
srcCard
=
new
Card
(
0
);
ImageForm
imgform
=
new
ImageForm
();
...
...
@@ -86,25 +87,19 @@ void DataEditFormLoad(object sender, EventArgs e)
void
InitPath
()
{
GAMEPATH
=
Application
.
StartupPath
;
INIPATH
=
Path
.
Combine
(
GAMEPATH
,
"DataEditorX.txt"
);
if
(
File
.
Exists
(
INIPATH
))
{
string
[]
lines
=
File
.
ReadAllLines
(
INIPATH
,
Encoding
.
UTF8
);
GAMEPATH
=(
lines
.
Length
>
0
)?
lines
[
0
]:
Application
.
StartupPath
;
UPDATEURL
=(
lines
.
Length
>
1
)?
lines
[
1
]:
"http://247321453@ys168.com"
;
GITURL
=(
lines
.
Length
>
2
)?
lines
[
2
]:
"https://github.com/247321453/DataEditorX"
;
}
else
string
datapath
=
Path
.
Combine
(
Application
.
StartupPath
,
"data"
);
string
txt
=
Path
.
Combine
(
datapath
,
"ygopro.txt"
);
if
(
File
.
Exists
(
txt
))
{
GAMEPATH
=
Application
.
StartupPath
;
UPDATEURL
=
"http://247321453@ys168.com"
;
GITURL
=
"https://github.com/247321453/DataEcitorX"
;
string
[]
lines
=
File
.
ReadAllLines
(
txt
,
Encoding
.
UTF8
);
if
(
Directory
.
Exists
(
lines
[
0
]))
GAMEPATH
=(
lines
.
Length
>
0
)?
lines
[
0
]:
Application
.
StartupPath
;
else
MyMsg
.
Warning
(
string
.
Format
(
"游戏目录不存在,请重新设置。\n{0}\n设置文件:\n{0}"
,
lines
[
0
],
txt
));
}
PICPATH
=
Path
.
Combine
(
GAMEPATH
,
"pics"
);
LUAPTH
=
Path
.
Combine
(
GAMEPATH
,
"script"
);
string
datapath
=
Path
.
Combine
(
Application
.
StartupPath
,
"data"
);
confrule
=
Path
.
Combine
(
datapath
,
"card-rule.txt"
);
confattribute
=
Path
.
Combine
(
datapath
,
"card-attribute.txt"
);
confrace
=
Path
.
Combine
(
datapath
,
"card-race.txt"
);
...
...
@@ -116,8 +111,7 @@ void InitPath()
}
void
DataEditFormFormClosing
(
object
sender
,
FormClosingEventArgs
e
)
{
if
(!
File
.
Exists
(
INIPATH
))
File
.
WriteAllLines
(
INIPATH
,
new
string
[]{
GAMEPATH
,
UPDATEURL
,
GITURL
},
Encoding
.
UTF8
);
}
void
SaveDic
(
string
file
,
Dictionary
<
long
,
string
>
dic
)
...
...
@@ -794,7 +788,10 @@ void Menuitem_aboutClick(object sender, EventArgs e)
void
Menuitem_checkupdateClick
(
object
sender
,
EventArgs
e
)
{
System
.
Diagnostics
.
Process
.
Start
(
UPDATEURL
);
if
(
MyUpdate
.
CheckUpdate
())
{
MyUpdate
.
Download
();
}
}
void
Menuitem_githubClick
(
object
sender
,
EventArgs
e
)
{
...
...
DataEditorX/DataEditorX.csproj
View file @
9217edf9
...
...
@@ -56,6 +56,7 @@
<DependentUpon>
ImageForm.cs
</DependentUpon>
</Compile>
<Compile
Include=
"MyMsg.cs"
/>
<Compile
Include=
"MyUpdate.cs"
/>
<Compile
Include=
"Program.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
</ItemGroup>
...
...
@@ -73,9 +74,6 @@
<Folder
Include=
"Update"
/>
</ItemGroup>
<ItemGroup>
<None
Include=
"DataEditorX.txt"
>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</None>
<None
Include=
"Data\card-attribute.txt"
>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</None>
...
...
@@ -100,6 +98,9 @@
<None
Include=
"Data\cover.jpg"
>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</None>
<None
Include=
"Data\ygopro.txt"
>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</None>
<None
Include=
"readme.txt"
>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</None>
...
...
DataEditorX/DataEditorX.txt
deleted
100644 → 0
View file @
737b767a
F:\game\YGOPRO
http://247321453.ys168.com
https://github.com/247321453/DataEditorX
\ No newline at end of file
DataEditorX/MyUpdate.cs
0 → 100644
View file @
9217edf9
/*
* 由SharpDevelop创建。
* 用户: Acer
* 日期: 5月21 星期三
* 时间: 10:10
*
*/
using
System
;
using
System.IO
;
using
System.Text
;
using
System.Net
;
using
System.Windows.Forms
;
namespace
DataEditorX
{
/// <summary>
/// Description of MyUpdate.
/// </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
()
{
string
ver
,
lasttime
;
int
l
=-
1
;
string
html
=
GetHtmlContentByUrl
(
VERURL
);
if
(
string
.
IsNullOrEmpty
(
html
))
{
MyMsg
.
Error
(
"无法获取版本!"
);
return
false
;
}
l
=
html
.
IndexOf
(
" "
);
ver
=(
l
>=
0
)?
html
.
Substring
(
0
,
l
):
"?.?.?.?"
;
lasttime
=(
l
>=
0
)?
html
.
Substring
(
l
):
"????-??-?? ??:??"
;
MyMsg
.
Show
(
"当前版本:"
+
Application
.
ProductVersion
+
"\n最新版本:"
+
ver
+
"\n最后更新时间:"
+
lasttime
);
return
false
;
}
public
static
void
Download
()
{
}
/// <summary>
///根据url获取网站html内容 /// </summary>
/// <param name="url">网址</param> /// <returns>获取网站html内容</returns>
public
static
string
GetHtmlContentByUrl
(
string
url
)
{
string
htmlContent
=
string
.
Empty
;
try
{
HttpWebRequest
httpWebRequest
=
(
HttpWebRequest
)
WebRequest
.
Create
(
url
);
httpWebRequest
.
Timeout
=
5000
;
using
(
HttpWebResponse
httpWebResponse
=
(
HttpWebResponse
)
httpWebRequest
.
GetResponse
())
{
using
(
Stream
stream
=
httpWebResponse
.
GetResponseStream
())
{
using
(
StreamReader
streamReader
=
new
StreamReader
(
stream
,
Encoding
.
UTF8
))
{
htmlContent
=
streamReader
.
ReadToEnd
();
streamReader
.
Close
();
}
stream
.
Close
();
}
httpWebResponse
.
Close
();
}
return
htmlContent
;
}
catch
{
}
return
""
;
}
}
}
DataEditorX/Update/version.txt
View file @
9217edf9
1.1.0.3
2014-5-21 10:00
\ No newline at end of file
1.1.0.3 2014-5-21 10:00
\ No newline at end of file
DataEditorX/readme.txt
View file @
9217edf9
...
...
@@ -15,8 +15,7 @@
2.更新网址
3.源码网址
DataEditorX.txt
F:\game\YGOPRO
http://247321453.ys168.com
https://github.com/247321453/DataEditorX
★设置游戏路径
data\ygopro.txt
注意:文本编码:UTF-8,最好是完整路径
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