Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AD-Control-Golang
Overview
Overview
Details
Activity
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
陶腾飞
AD-Control-Golang
Commits
42060ed5
Commit
42060ed5
authored
Jul 09, 2020
by
陶腾飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v1.2.0 更新批量打开工具
parent
27a73c30
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
4 deletions
+52
-4
.gitignore
+1
-0
public/env.go
+1
-1
public/print.go
+0
-0
public/public.go
+3
-0
public/win.go
+1
-0
users/menu.go
+46
-3
No files found.
.gitignore
View file @
42060ed5
test/
testmain/
exe/
*.bat
*.ps1
...
...
public/env.go
View file @
42060ed5
...
...
@@ -9,7 +9,7 @@ const DaemonListen string = ":" + DaemonPort
const
ADServerDaemon
string
=
Host_adserver
+
DaemonListen
var
LocalDaemon
string
=
User_computername
+
DaemonListen
const
RandMax
int
=
60
const
Version
string
=
"1.
1.2
"
const
Version
string
=
"1.
2.0
"
// user //
...
...
public/print.go
View file @
42060ed5
public/public.go
View file @
42060ed5
...
...
@@ -115,6 +115,9 @@ func TrimPrefix(str ,s string)string{
func
IndexString
(
str
,
sub
string
)
int
{
return
strings
.
Index
(
str
,
sub
)
}
func
Splitln
(
str
string
)[]
string
{
return
strings
.
Split
(
str
,
"
\n
"
)
}
func
Exit
(){
os
.
Exit
(
0
)
}
...
...
public/win.go
View file @
42060ed5
...
...
@@ -127,6 +127,7 @@ func Execcmd_nowait_noargs(app string){
}
}
//
//
// local
...
...
users/menu.go
View file @
42060ed5
package
main
import
(
"github.com/lxn/walk"
.
"github.com/lxn/walk/declarative"
"fmt"
pub
"AD-Control/public"
)
...
...
@@ -262,7 +264,7 @@ func wxdsExplain(){
func
menuInitTools
(
ni
*
walk
.
NotifyIcon
){
fa
:=
"工具集合"
sub
:=
[
...
]
string
{
"Excel关键词分割"
,
"备份用户文件"
,
"隐藏桌面图标"
,
"显示桌面图标"
,
"更新手机代理程序"
,
"移动硬盘(胡一波)"
,
"键盘驱动(徐文强)"
,
"测试"
}
sub
:=
[
...
]
string
{
"Excel关键词分割"
,
"备份用户文件"
,
"
优雅批量打开网页"
,
"
隐藏桌面图标"
,
"显示桌面图标"
,
"更新手机代理程序"
,
"移动硬盘(胡一波)"
,
"键盘驱动(徐文强)"
,
"测试"
}
// 建立空菜单
nm
,
err
:=
walk
.
NewMenu
()
if
err
!=
nil
{
...
...
@@ -295,10 +297,12 @@ func menuInitTools(ni * walk.NotifyIcon){
case
1
:
na
.
Triggered
()
.
Attach
(
tBakcupUser
)
case
2
:
na
.
Triggered
()
.
Attach
(
t
HideIcon
)
na
.
Triggered
()
.
Attach
(
t
BatchOpenWeb
)
case
3
:
na
.
Triggered
()
.
Attach
(
t
Show
Icon
)
na
.
Triggered
()
.
Attach
(
t
Hide
Icon
)
case
4
:
na
.
Triggered
()
.
Attach
(
tShowIcon
)
case
5
:
na
.
Triggered
()
.
Attach
(
tUpdateATool
)
case
lastone
-
2
:
na
.
Triggered
()
.
Attach
(
t_movedisk_huyibo
)
...
...
@@ -329,6 +333,45 @@ func menuInitTools(ni * walk.NotifyIcon){
func
tMultiSplit
(){
pub
.
Execcmd_nowait
(
pub
.
Cmd_K_Start
+
pub
.
App_MultiSplit
)
}
// 其他工具 优雅批量打开网页
func
tBatchOpenWeb
(){
var
inTE
,
outTE
*
walk
.
TextEdit
MainWindow
{
Title
:
"优雅批量打开网页"
,
Size
:
Size
{
600
,
200
},
Layout
:
VBox
{},
Children
:
[]
Widget
{
HSplitter
{
Children
:
[]
Widget
{
TextEdit
{
AssignTo
:
&
inTE
,
VScroll
:
true
},
TextEdit
{
AssignTo
:
&
outTE
,
ReadOnly
:
true
,
VScroll
:
true
},
},
},
PushButton
{
Text
:
"打开网页"
,
OnClicked
:
func
()
{
for
seq
,
web
:=
range
pub
.
Splitln
(
inTE
.
Text
()){
if
web
==
""
{
continue
}
pub
.
Execcmd_nowait
(
`C:\Progra~2\Google\Chrome\Application\chrome.exe `
+
web
)
pub
.
Delay
(
2
)
outTE
.
AppendText
(
fmt
.
Sprintf
(
"%d %s
\n
"
,
seq
+
1
,
web
))
}
},
},
PushButton
{
Text
:
"清空"
,
OnClicked
:
func
()
{
inTE
.
SetText
(
""
)
outTE
.
SetText
(
""
)
},
},
},
}
.
Run
()
}
// 其他工具 备份用户文件
func
tBakcupUser
(){
if
pub
.
Msg_YesNo
(
"是否执行一次手动备份用户文件夹。目标文件夹:"
+
pub
.
Dir_userprofile
)
==
1
{
...
...
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