Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
Ftt_Common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Ftt_Common
Commits
800c7b7d
Commit
800c7b7d
authored
Jun 30, 2021
by
tr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、帮助文档:增加更新文件功能
parent
888e7cfa
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
155 additions
and
75 deletions
+155
-75
wHelpDocument.Designer.cs
Tools/UI/sys/wHelpDocument.Designer.cs
+18
-1
wHelpDocument.cs
Tools/UI/sys/wHelpDocument.cs
+71
-21
wHelpDocument.resx
Tools/UI/sys/wHelpDocument.resx
+0
-9
wMain.Designer.cs
Tools/wMain.Designer.cs
+53
-36
wMain.cs
Tools/wMain.cs
+12
-1
wMain.resx
Tools/wMain.resx
+1
-7
No files found.
Tools/UI/sys/wHelpDocument.Designer.cs
View file @
800c7b7d
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
this
.
panel1
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
panel1
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
panel2
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
panel2
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnUpdate
=
new
System
.
Windows
.
Forms
.
Button
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
dgvDetail
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
dgvDetail
)).
BeginInit
();
this
.
panel1
.
SuspendLayout
();
this
.
panel1
.
SuspendLayout
();
this
.
panel2
.
SuspendLayout
();
this
.
panel2
.
SuspendLayout
();
...
@@ -84,7 +85,7 @@
...
@@ -84,7 +85,7 @@
this
.
btnUpload
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Window
;
this
.
btnUpload
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Window
;
this
.
btnUpload
.
Enabled
=
false
;
this
.
btnUpload
.
Enabled
=
false
;
this
.
btnUpload
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnUpload
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnUpload
.
Location
=
new
System
.
Drawing
.
Point
(
1
4
,
6
);
this
.
btnUpload
.
Location
=
new
System
.
Drawing
.
Point
(
1
2
,
6
);
this
.
btnUpload
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
,
4
,
3
,
4
);
this
.
btnUpload
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
,
4
,
3
,
4
);
this
.
btnUpload
.
Name
=
"btnUpload"
;
this
.
btnUpload
.
Name
=
"btnUpload"
;
this
.
btnUpload
.
Size
=
new
System
.
Drawing
.
Size
(
87
,
27
);
this
.
btnUpload
.
Size
=
new
System
.
Drawing
.
Size
(
87
,
27
);
...
@@ -110,6 +111,7 @@
...
@@ -110,6 +111,7 @@
// panel1
// panel1
//
//
this
.
panel1
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
234
)))),
((
int
)(((
byte
)(
245
)))),
((
int
)(((
byte
)(
255
)))));
this
.
panel1
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
234
)))),
((
int
)(((
byte
)(
245
)))),
((
int
)(((
byte
)(
255
)))));
this
.
panel1
.
Controls
.
Add
(
this
.
btnUpdate
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnDownload
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnDownload
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnUpload
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnUpload
);
this
.
panel1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Top
;
this
.
panel1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Top
;
...
@@ -140,6 +142,20 @@
...
@@ -140,6 +142,20 @@
this
.
label1
.
TabIndex
=
0
;
this
.
label1
.
TabIndex
=
0
;
this
.
label1
.
Text
=
"*温馨提示:超过50M的文件将被直接忽略"
;
this
.
label1
.
Text
=
"*温馨提示:超过50M的文件将被直接忽略"
;
//
//
// btnUpdate
//
this
.
btnUpdate
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Window
;
this
.
btnUpdate
.
Enabled
=
false
;
this
.
btnUpdate
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnUpdate
.
Location
=
new
System
.
Drawing
.
Point
(
560
,
6
);
this
.
btnUpdate
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
,
4
,
3
,
4
);
this
.
btnUpdate
.
Name
=
"btnUpdate"
;
this
.
btnUpdate
.
Size
=
new
System
.
Drawing
.
Size
(
87
,
27
);
this
.
btnUpdate
.
TabIndex
=
2
;
this
.
btnUpdate
.
Text
=
"更新文件"
;
this
.
btnUpdate
.
UseVisualStyleBackColor
=
false
;
this
.
btnUpdate
.
Click
+=
new
System
.
EventHandler
(
this
.
btnUpdate_Click
);
//
// wHelpDocument
// wHelpDocument
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
...
@@ -173,5 +189,6 @@
...
@@ -173,5 +189,6 @@
private
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
Column4
;
private
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
Column4
;
private
System
.
Windows
.
Forms
.
Panel
panel2
;
private
System
.
Windows
.
Forms
.
Panel
panel2
;
private
System
.
Windows
.
Forms
.
Label
label1
;
private
System
.
Windows
.
Forms
.
Label
label1
;
private
System
.
Windows
.
Forms
.
Button
btnUpdate
;
}
}
}
}
\ No newline at end of file
Tools/UI/sys/wHelpDocument.cs
View file @
800c7b7d
...
@@ -56,32 +56,18 @@ namespace Tools.UI.sys
...
@@ -56,32 +56,18 @@ namespace Tools.UI.sys
//事件:上传
//事件:上传
private
void
btnUpload_Click
(
object
sender
,
EventArgs
e
)
private
void
btnUpload_Click
(
object
sender
,
EventArgs
e
)
{
{
var
dlg
=
new
OpenFileDialog
()
{
var
list
=
this
.
SelectFile
(
true
);
CheckFileExists
=
true
,
if
(
list
.
Count
>
0
)
CheckPathExists
=
true
,
Multiselect
=
true
,
Filter
=
"所有文件|*.*"
,
InitialDirectory
=
Utils
.
DesktopPath
,
};
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
)
{
{
foreach
(
string
path
in
dlg
.
FileNames
)
foreach
(
string
path
in
list
)
{
{
//读取文件
var
bytes
=
File
.
ReadAllBytes
(
path
);
var
KB
=
bytes
.
Length
/
1024
M
;
//超过50M直接忽略
if
(
KB
>
50
*
1024
)
continue
;
//添加文件
//添加文件
var
drNew
=
this
.
_ds
.
Tables
[
0
].
NewRow
();
var
drNew
=
this
.
_ds
.
Tables
[
0
].
NewRow
();
drNew
[
"dName"
]
=
Path
.
GetFileName
(
path
);
if
(
this
.
FillRowData
(
drNew
,
path
))
drNew
[
"dSize"
]
=
KB
.
ToString
(
"0.##"
);
{
drNew
[
"dData"
]
=
bytes
;
drNew
[
"CreateDate"
]
=
DateTime
.
Now
;
drNew
.
EndEdit
();
this
.
_ds
.
Tables
[
0
].
Rows
.
Add
(
drNew
);
this
.
_ds
.
Tables
[
0
].
Rows
.
Add
(
drNew
);
}
}
}
this
.
Save
();
this
.
Save
();
}
}
}
}
...
@@ -112,12 +98,76 @@ namespace Tools.UI.sys
...
@@ -112,12 +98,76 @@ namespace Tools.UI.sys
Utils
.
Tip
(
"下载成功!"
);
Utils
.
Tip
(
"下载成功!"
);
}
}
}
}
//事件:更新文件
private
void
btnUpdate_Click
(
object
sender
,
EventArgs
e
)
{
if
(
this
.
dgvDetail
.
SelectedRows
.
Count
!=
1
)
{
Utils
.
Tip
(
"更新必须且只能选中一行!"
);
return
;
}
var
list
=
this
.
SelectFile
(
false
);
if
(
list
.
Count
>
0
)
{
//更新文件
var
index
=
this
.
dgvDetail
.
SelectedRows
[
0
].
Index
;
var
drNow
=
this
.
_ds
.
Tables
[
0
].
DefaultView
[
index
].
Row
;
if
(
this
.
FillRowData
(
drNow
,
list
[
0
]))
{
this
.
Save
();
}
}
}
//按钮有效性
//按钮有效性
private
void
ButtonEnabled
(
bool
enable
)
private
void
ButtonEnabled
(
bool
enable
)
{
{
this
.
btnUpload
.
Enabled
=
enable
;
this
.
btnUpload
.
Enabled
=
enable
;
this
.
btnDownload
.
Enabled
=
enable
;
this
.
btnDownload
.
Enabled
=
enable
;
this
.
btnUpdate
.
Enabled
=
enable
;
}
}
//选择文件
private
List
<
string
>
SelectFile
(
bool
isMulti
,
string
filter
=
"所有文件|*.*"
)
{
var
result
=
new
List
<
string
>();
var
dlg
=
new
OpenFileDialog
()
{
CheckFileExists
=
true
,
CheckPathExists
=
true
,
Multiselect
=
isMulti
,
Filter
=
filter
,
InitialDirectory
=
Utils
.
DesktopPath
,
};
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
)
{
result
=
dlg
.
FileNames
.
ToList
();
}
return
result
;
}
//检查文件尺寸
private
bool
CheckSize
(
decimal
kb
)
{
return
kb
<=
50
*
1024
;
}
//填充数据行
private
bool
FillRowData
(
DataRow
dr
,
string
path
)
{
//读取文件
var
bytes
=
File
.
ReadAllBytes
(
path
);
var
KB
=
bytes
.
Length
/
1024
M
;
//超过50M直接忽略
if
(!
this
.
CheckSize
(
KB
))
return
false
;
//添加文件
dr
[
"dName"
]
=
Path
.
GetFileName
(
path
);
dr
[
"dSize"
]
=
KB
.
ToString
(
"0.##"
);
dr
[
"dData"
]
=
bytes
;
dr
[
"CreateDate"
]
=
DateTime
.
Now
;
dr
.
EndEdit
();
return
true
;
}
}
}
}
}
Tools/UI/sys/wHelpDocument.resx
View file @
800c7b7d
...
@@ -126,13 +126,4 @@
...
@@ -126,13 +126,4 @@
<metadata
name=
"Column4.UserAddedColumn"
type=
"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>
<metadata
name=
"Column4.UserAddedColumn"
type=
"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>
<value>
True
</value>
<value>
True
</value>
</metadata>
</metadata>
<metadata
name=
"Column1.UserAddedColumn"
type=
"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>
<value>
True
</value>
</metadata>
<metadata
name=
"Column2.UserAddedColumn"
type=
"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>
<value>
True
</value>
</metadata>
<metadata
name=
"Column4.UserAddedColumn"
type=
"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>
<value>
True
</value>
</metadata>
</root>
</root>
\ No newline at end of file
Tools/wMain.Designer.cs
View file @
800c7b7d
This diff is collapsed.
Click to expand it.
Tools/wMain.cs
View file @
800c7b7d
...
@@ -7,6 +7,7 @@ using System.Drawing;
...
@@ -7,6 +7,7 @@ using System.Drawing;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
//
//
...
@@ -64,6 +65,17 @@ namespace Tools
...
@@ -64,6 +65,17 @@ namespace Tools
//检查更新
//检查更新
Task
.
Run
(()
=>
this
.
CheckUpdate
(
true
));
Task
.
Run
(()
=>
this
.
CheckUpdate
(
true
));
//加载首页
Task
.
Run
(()
=>
this
.
AsyncUI
(()
=>
{
this
.
webBrowser1
.
Url
=
new
Uri
(
"http://www.feteto.cn/#/"
);
this
.
webBrowser1
.
Show
();
})
);
}
private
void
wMain_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
{
this
.
webBrowser1
.
Hide
();
this
.
webBrowser1
.
Dispose
();
}
}
#
region
基础:关闭、最大化、最小化
#
region
基础:关闭、最大化、最小化
...
@@ -420,6 +432,5 @@ namespace Tools
...
@@ -420,6 +432,5 @@ namespace Tools
MessageBox
.
Show
(
msg
,
"提示"
);
MessageBox
.
Show
(
msg
,
"提示"
);
}
}
}
}
}
}
Tools/wMain.resx
View file @
800c7b7d
...
@@ -117,9 +117,6 @@
...
@@ -117,9 +117,6 @@
<resheader
name=
"writer"
>
<resheader
name=
"writer"
>
<value>
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
<value>
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
</resheader>
<metadata
name=
"menuStrip1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<value>
478, 17
</value>
</metadata>
<metadata
name=
"imageList1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<metadata
name=
"imageList1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<value>
598, 17
</value>
<value>
598, 17
</value>
</metadata>
</metadata>
...
@@ -128,7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gAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
...
@@ -252,9 +249,6 @@
...
@@ -252,9 +249,6 @@
<metadata
name=
"menuStrip1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<metadata
name=
"menuStrip1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<value>
478, 17
</value>
<value>
478, 17
</value>
</metadata>
</metadata>
<metadata
name=
"toolTip1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<value>
713, 17
</value>
</metadata>
<metadata
name=
"timer1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<metadata
name=
"timer1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<value>
814, 17
</value>
<value>
814, 17
</value>
</metadata>
</metadata>
...
...
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