Commit 633791ee by 陶腾飞

v10.0:强制备用户文件方法,日志输出到特定目录,优化变量名

parent 8d592ff9
*.bat *.bat
*.ps1 *.ps1
/*test /*test
/*.exe /*/*.exe
/logs /logs
\ No newline at end of file
No preview for this file type
No preview for this file type
package main package main
import ( import (
"AD-Control/public" pub "AD-Control/public"
"flag" "flag"
) )
func main(){ func main(){
public.Loger = public.NewLoger(public.Dir_tmp + `\adct.log`) pub.Loger = pub.NewLoger(pub.Dir_tmp + `\adct.log`)
var backupText = flag.String(public.Msg_Backup,"","backup status to AD") var backupText = flag.String(pub.Msg_Backup,"","backup status to AD")
var reportText = flag.String(public.Msg_Report,"","report to AD") var reportText = flag.String(pub.Msg_Report,"","report to AD")
var execText = flag.String(public.Msg_Exec,"","exec to LocalDaemon") var execText = flag.String(pub.Msg_Exec,"","exec to LocalDaemon")
var regText = flag.String(public.Msg_Reg,"","mod reg") var regText = flag.String(pub.Msg_Reg,"","mod reg")
var userText = flag.String("user","","who is running me") var userText = flag.String("user","","who is running me")
var wolmacText = flag.String("wolmac","","input mac address for wake pc") var wolmacText = flag.String("wolmac","","input mac address for wake pc")
...@@ -32,72 +32,46 @@ func main(){ ...@@ -32,72 +32,46 @@ func main(){
return return
} }
func flag_report(s *string,user * string){ func flag_report(s *string,user * string){
pub.SendServer(pub.GJreport(*s,*user))
switch *s {
case public.Msg_Report_UserStart:
public.Reg_Write_DC(
public.Reg_Name_loginUserName,
*user)
public.Reg_Write_DC(
public.Reg_Name_loginTime,
public.GetStrTime())
public.SendServer(public.GJreport(*s,*user))
case public.Msg_Report_StartBak:
var name string = public.Reg_Query_DC(public.Reg_Name_loginUserName)
public.SendServer(public.GJreport(public.Msg_Report_StartBak,name))
case public.Msg_Report_OverBak:
var name string = public.Reg_Query_DC(public.Reg_Name_loginUserName)
public.Reg_Write_DC(public.Reg_Name_BackupUserName,name)
public.Reg_Write_DC(public.Reg_Name_BackupOverTime,public.GetStrTime())
public.SendServer(public.GJreport(public.Msg_Report_OverBak,name))
}
} }
func flag_bakcup(s *string){ func flag_bakcup(s *string){
; ;
} }
func flag_exec(s * string){ func flag_exec(s * string){
public.SendServerExec(*s) pub.SendServerExec(*s)
} }
func flag_reg(s * string){ func flag_reg(s * string){
; ;
} }
func flag_wolmac(mac * string){ func flag_wolmac(mac * string){
if err := public.Wol(*mac); err != nil{ if err := pub.Wol(*mac); err != nil{
public.PntWol(err) pub.PntWol(err)
} else { } else {
public.PntWol(*mac) pub.PntWol(*mac)
} }
} }
func flag_woluser(user * string){ func flag_woluser(user * string){
public.PntWol("暂未开发") pub.PntWol("暂未开发")
} }
func flag_hour(){ func flag_hour(){
nh := public.GetHour() nh := pub.GetHour()
switch nh{ switch nh{
case 0: case 0:
public.SendServerExec(public.Msg_Exec_CloseWindows) pub.SendServerExec(pub.Msg_Report_TurnOffPC)
break break
case 1: case 1:
public.SendServerExec(public.Msg_Exec_CloseWindows) pub.SendServerExec(pub.Msg_Report_TurnOffPC)
break break
case 2: case 2:
public.SendServerExec(public.Msg_Exec_CloseWindows) pub.SendServerExec(pub.Msg_Report_TurnOffPC)
break break
case 3: case 3:
public.SendServerExec(public.Msg_Exec_CloseWindows) pub.SendServerExec(pub.Msg_Report_TurnOffPC)
break break
case 4: case 4:
public.SendServerExec(public.Msg_Exec_CloseWindows) pub.SendServerExec(pub.Msg_Report_TurnOffPC)
break break
default : default :
break break
......
No preview for this file type
package main package main
import ( import (
"AD-Control/public" pub "AD-Control/public"
"net" "net"
"io" "io"
"bufio" "bufio"
...@@ -10,42 +10,42 @@ import ( ...@@ -10,42 +10,42 @@ import (
// 守护进程 初始化 // 守护进程 初始化
func daemonInit(){ func daemonInit(){
// 1 创建文件夹 // 1 创建文件夹
for _,i := range public.Dir_Be{ for _,i := range pub.Dir_Be{
if public.NotExist(i){ if pub.NotExist(i){
public.Mkdir(i) pub.Mkdir(i)
} }
} }
if public.Adserver() { var logpath string
if pub.Adserver() {
// 2 初始化 微盘复制状态 // 2 初始化 微盘复制状态
public.CopyStatusWeDrive = make(map[string]bool) pub.CopyStatusWeDrive = make(map[string]bool)
public.CopyStatusWeDrive[public.Zhiwei_Dept_HB] = true pub.CopyStatusWeDrive[pub.Zhiwei_Dept_HB] = true
public.CopyStatusWeDrive[public.Zhiwei_Dept_LP] = true pub.CopyStatusWeDrive[pub.Zhiwei_Dept_LP] = true
public.CopyStatusWeDrive[public.Zhiwei_Dept_JR] = true pub.CopyStatusWeDrive[pub.Zhiwei_Dept_JR] = true
public.CopyStatusWeDrive[public.Zhiwei_Dept_JD] = true pub.CopyStatusWeDrive[pub.Zhiwei_Dept_JD] = true
public.CopyStatusWeDrive[public.Zhiwei_Dept_TXHD] = true pub.CopyStatusWeDrive[pub.Zhiwei_Dept_TXHD] = true
public.CopyStatusWeDrive[public.Zhiwei_Dept_TXWJ] = true pub.CopyStatusWeDrive[pub.Zhiwei_Dept_TXWJ] = true
public.CopyStatusWeDrive[public.Zhiwei_Dept_BGYJZX] = true pub.CopyStatusWeDrive[pub.Zhiwei_Dept_BGYJZX] = true
public.CopyStatusWeDrive[public.Zhiwei_Dept_TECH] = true pub.CopyStatusWeDrive[pub.Zhiwei_Dept_TECH] = true
// 日志文件位置:主控源文件的源文件目录 // 日志文件位置:主控源文件的源文件目录
public.Loger = public.NewLoger(`C:\Users\Administrator\go\src\AD-Control\logs\daemon.log`) logpath = `C:\Users\Administrator\go\src\AD-Control\logs\daemon.log`
} else { } else {
// 日志文件位置:域计算机的备份目录:C:\windows\temp // 日志文件位置:域计算机的备份目录:C:\windows\temp
public.Loger = public.NewLoger(public.Dir_tmp + `\daemon.log`) logpath = pub.Dir_tmp + `\daemon.log`
// 发送 Daemon Start
public.SendServerReport(public.Msg_Report_DaemonStart)
} }
//3 写入日志
pub.Loger = pub.NewLoger(logpath)
} }
// 守护进程 运行 // 守护进程 运行
func deamonRun(){ func deamonRun(){
daemonHost := public.User_computername daemonHost := pub.User_computername
listener, err := net.Listen("tcp", public.DaemonListen) listener, err := net.Listen("tcp", pub.DaemonListen)
if err != nil { if err != nil {
public.PntInfo("Listen Error ", err) pub.PntError("Listen Error ", err)
return return
} }
defer listener.Close() defer listener.Close()
...@@ -53,29 +53,29 @@ func deamonRun(){ ...@@ -53,29 +53,29 @@ func deamonRun(){
for{ for{
if conn, err := listener.Accept(); err == nil { if conn, err := listener.Accept(); err == nil {
// 新建 读取流 // 新建 读取流
if bmsg,cerr:= bufio.NewReader(conn).ReadBytes(public.EndSign) ; cerr != io.EOF { if bmsg,cerr:= bufio.NewReader(conn).ReadBytes(pub.EndSign) ; cerr != io.EOF {
// 获取ip // 获取ip
ip := public.GetConnIP(conn.RemoteAddr()) ip := pub.GetConnIP(conn.RemoteAddr())
// 获取消息类型 // 获取消息类型
msgtype := public.ParseJsonHead(bmsg) msgtype := pub.ParseJsonHead(bmsg)
// 处理消息 // 处理消息
rec := public.DealMsgEnter(ip,msgtype,bmsg) rec := pub.DealMsgEnter(ip,msgtype,bmsg)
// 写入连接 // 写入连接
conn.Write(rec) conn.Write(rec)
}else{ }else{
public.PntInfo(daemonHost," Conn Read Error ", cerr) pub.PntError(daemonHost," Conn Read Error ", cerr)
} }
// 关闭连接 // 关闭连接
if err := conn.Close() ; err!= nil{ if err := conn.Close() ; err!= nil{
public.PntInfo(err) pub.PntInfo(err)
} }
continue continue
}else{ }else{
public.PntInfo(daemonHost," Listen Error ", err) pub.PntError(daemonHost," Listen Error ", err)
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -98,18 +98,15 @@ const ( ...@@ -98,18 +98,15 @@ const (
) )
const Reg_Root_ac int = HKLM const Reg_Root_ac int = HKLM
const Reg_Root_dc int = HKCU const Reg_Root_dc int = HKCU
const Reg_Path_home string = `SOFTWARE\ADControl` const Reg_Path_home string = `SOFTWARE\ADControl`
const Reg_Path_home_dc string = Reg_Path_home + `\DomainComputer\` // use for adserver,not for dc const Reg_Path_home_ac string = Reg_Path_home + `\DomainComputer\` // use for adserver,not for dc
const Reg_Name_TurnOnTime string = "TurnOnTime" const Reg_Name_TurnOnTime string = "TurnOnTime"
const Reg_Name_TurnOffTime string = "TurnOffTime" const Reg_Name_TurnOffTime string = "TurnOffTime"
const Reg_Name_loginUserName string = "loginUser" const Reg_Name_LoginUserName string = "loginUser"
const Reg_Name_loginTime string = "loginTime" const Reg_Name_LoginTime string = "loginTime"
const Reg_Name_LogOffTime string = "LogOffTime"
const Reg_Name_BackupUserName string = "BackupUserName" const Reg_Name_BackupUserName string = "BackupUserName"
const Reg_Name_BackupOverTime string = "BackupOverTime" const Reg_Name_BackupOverTime string = "BackupOverTime"
// const Reg_Name_BackupSyncAppName string = "FreeFileSync"
// const Reg_Name_BackupSyncAppParm string = "FreeFileSyncParm"
const Reg_Name_WeDriveDir string = "WeDriveDir" const Reg_Name_WeDriveDir string = "WeDriveDir"
...@@ -125,3 +122,4 @@ const Link_WxworkBot string = `https://qyapi.weixin.qq.com/cgi-bin/webhook/s ...@@ -125,3 +122,4 @@ const Link_WxworkBot string = `https://qyapi.weixin.qq.com/cgi-bin/webhook/s
const Cmd_k string = "cmd /k " const Cmd_k string = "cmd /k "
const Cmd_K_Start string = "cmd /k start " const Cmd_K_Start string = "cmd /k start "
var CopyStatusWeDrive map [string]bool var CopyStatusWeDrive map [string]bool
...@@ -2,5 +2,5 @@ package public ...@@ -2,5 +2,5 @@ package public
import "errors" import "errors"
var Error_NullCommand = errors.New("NULL COMMAND ERROR ") var Error_NullCommand = errors.New("NULL COMMAND ")
var Error_NullRegQuery = errors.New("Null Reg Query") var Error_NullRegQuery = errors.New("Null Reg Query")
\ No newline at end of file
...@@ -58,40 +58,39 @@ func DealMsgEnter(ip string,msgtype string,unmsg []byte) []byte { ...@@ -58,40 +58,39 @@ func DealMsgEnter(ip string,msgtype string,unmsg []byte) []byte {
func (rep *MJreport)Msg_Deal() interface{} { func (rep *MJreport)Msg_Deal() interface{} {
switch rep.Instruction{ switch rep.Instruction{
case Msg_Report_Offwork: case Msg_Report_Offwork:
return GJbackup() return GJbackup()
case Msg_Report_StartBak: case Msg_Report_StartBak:
return GJbackup() return GJbackup()
case Msg_Report_OverBak: case Msg_Report_OverBak:
SysMsgBox(rep.Computername,`即将关机,如需取消关机,运行Z:\tools\【工具】取消关机.bat或在小工具-电源管理-取消自动关机`) SysMsgBox(rep.Computername,`即将关机,如需取消关机,运行Z:\tools\【工具】取消关机.bat或在小工具-电源管理-取消自动关机`)
return GJexecAck(Msg_Exec_CloseWindows) return GJexecAck(Msg_Exec_TurnOffPC)
case Msg_Report_CloseWindows:
Reg_Write_key_one( case Msg_Report_WillTurnOffPC:
Reg_Root_ac, rep.Reg_Write_Key_one_AC(
Reg_Path_home_dc + rep.Computername, Reg_Name_TurnOffTime,
Reg_Name_TurnOnTime,
UnixTimeParse(&rep.Timestamp)) UnixTimeParse(&rep.Timestamp))
case Msg_Report_DaemonStart: case Msg_Report_WillTurnOnPC:
Reg_Write_key_one( rep.Reg_Write_Key_one_AC(
Reg_Root_ac,
Reg_Path_home_dc + rep.Computername,
Reg_Name_TurnOffTime, Reg_Name_TurnOffTime,
UnixTimeParse(&rep.Timestamp)) UnixTimeParse(&rep.Timestamp))
case Msg_Report_UserStart: case Msg_Report_WillLogInUser:
Reg_Write_key_one( rep.Reg_Write_Key_one_AC(
Reg_Root_ac, Reg_Name_LoginUserName,
Reg_Path_home_dc + rep.Computername,
Reg_Name_loginUserName,
rep.Username) rep.Username)
Reg_Write_key_one( rep.Reg_Write_Key_one_AC(
Reg_Root_ac, Reg_Name_LoginTime,
Reg_Path_home_dc + rep.Computername,
Reg_Name_loginTime,
UnixTimeParse(&rep.Timestamp)) UnixTimeParse(&rep.Timestamp))
case Msg_Report_WillLogOutUser:
rep.Reg_Write_Key_one_AC(
Reg_Name_LogOffTime,
UnixTimeParse(&rep.Timestamp))
case Msg_Report_OverCopyToWeDrive: case Msg_Report_OverCopyToWeDrive:
...@@ -115,11 +114,11 @@ func (exec *MJexec)Msg_Deal()interface{}{ ...@@ -115,11 +114,11 @@ func (exec *MJexec)Msg_Deal()interface{}{
exec.IfDelay = false exec.IfDelay = false
switch exec.Instruction{ switch exec.Instruction{
case Msg_Exec_CloseWindows: case Msg_Exec_TurnOffPC:
exec.Command = Msg_Exec_CloseWindows_cmd exec.Command = Msg_Exec_TurnOffPC_cmd
case Msg_Exec_CancelCloseWindows: case Msg_Exec_CancelTurnOffPC:
exec.Command = Msg_Exec_CancelCloseWindows_cmd exec.Command = Msg_Exec_CancelTurnOffPC_cmd
case Msg_Exec_LogOffUser: case Msg_Exec_LogOffUser:
exec.Command = Msg_Exec_LogOffUser_cmd exec.Command = Msg_Exec_LogOffUser_cmd
...@@ -127,8 +126,6 @@ func (exec *MJexec)Msg_Deal()interface{}{ ...@@ -127,8 +126,6 @@ func (exec *MJexec)Msg_Deal()interface{}{
case Msg_Exec_RebootWindows: case Msg_Exec_RebootWindows:
exec.Command = Msg_Exec_RebootWindows_cmd exec.Command = Msg_Exec_RebootWindows_cmd
} }
switch exec.Status{ switch exec.Status{
...@@ -204,7 +201,6 @@ func (bak * MJbackup)Msg_Deal() interface{}{ ...@@ -204,7 +201,6 @@ func (bak * MJbackup)Msg_Deal() interface{}{
case Msg_Backup_Status_Start: case Msg_Backup_Status_Start:
if !PrimaryUser(bak.Username) { return nil } if !PrimaryUser(bak.Username) { return nil }
bak.Username = User_name bak.Username = User_name
bak.Computername = User_computername bak.Computername = User_computername
bak.Explain = "Backup Start" bak.Explain = "Backup Start"
...@@ -235,6 +231,8 @@ func (bak * MJbackup)Msg_Deal() interface{}{ ...@@ -235,6 +231,8 @@ func (bak * MJbackup)Msg_Deal() interface{}{
// 判断是否能进行备份 // 判断是否能进行备份
case Msg_Backup_Status_If: case Msg_Backup_Status_If:
bak.Username = HostnameToUsername(&bak.Username)
// 如果ffs的配置文件不存在 或者 是旧版本 // 如果ffs的配置文件不存在 或者 是旧版本
// 读取新文件 // 读取新文件
if !bak.BatchFileExist || bak.Version != BackupVersion{ if !bak.BatchFileExist || bak.Version != BackupVersion{
......
...@@ -17,15 +17,30 @@ const Msg_Backup string = "backup" ...@@ -17,15 +17,30 @@ const Msg_Backup string = "backup"
const Msg_Reg string = "reg" const Msg_Reg string = "reg"
const Msg_Error string = "error" const Msg_Error string = "error"
// base word ////////////////////////////////////////////////////////////////
const LogInUser string = "LogInUser"
const LogOutUser string = "LogOutUser"
const WillLogInUser string = "WillLogInUser"
const WillLogOutUser string = "WillLogOutUser"
const TurnOnPC string = "TurnOnPC"
const TurnOffPC string = "TurnOffPC"
const WillTurnOnPC string = "WillTurnOnPC"
const WillTurnOffPC string = "WillTurnOffPC"
// msg report type /////////////////////////////////////////////////////////// // msg report type ///////////////////////////////////////////////////////////
const Msg_Report_DaemonStart string = "DaemonStart" const Msg_Report_LoginInUser string = LogInUser
const Msg_Report_UserStart string = "UserStart" const Msg_Report_LogOutUser string = LogInUser
const Msg_Report_WillLogInUser string = WillLogInUser
const Msg_Report_WillLogOutUser string = WillLogOutUser
const Msg_Report_TurnOnPC string = TurnOnPC
const Msg_Report_TurnOffPC string = TurnOffPC
const Msg_Report_WillTurnOnPC string = WillTurnOnPC
const Msg_Report_WillTurnOffPC string = WillTurnOffPC
const Msg_Report_Offwork string = "offwork" const Msg_Report_Offwork string = "offwork"
const Msg_Report_CloseWindows string = "closewindows"
const Msg_Report_OverCopyToWeDrive string = "overcopytowedrive" const Msg_Report_OverCopyToWeDrive string = "overcopytowedrive"
const Msg_Report_OverCopyToDeptShare string = "OverCopyToDeptShare" const Msg_Report_OverCopyToDeptShare string = "OverCopyToDeptShare"
const Msg_Report_StartBak string = "startbak" const Msg_Report_StartBak string = "startbak"
const Msg_Report_OverBak string = "overbak" const Msg_Report_OverBak string = "overbak"
...@@ -46,17 +61,15 @@ const ( ...@@ -46,17 +61,15 @@ const (
) )
const Msg_Exec_State_Request string = "request" const Msg_Exec_State_Request string = "request"
const Msg_Exec_State_Ack string = "ack" const Msg_Exec_State_Ack string = "ack"
const Msg_Exec_CloseWindows string = "closewindow" const Msg_Exec_TurnOffPC string = TurnOffPC
const Msg_Exec_CloseWindows_cmd string = "shutdown -s -t 300" const Msg_Exec_TurnOffPC_cmd string = "shutdown -s -t 300"
const Msg_Exec_CancelCloseWindows string = "cancelclosewindows" const Msg_Exec_CancelTurnOffPC string = "cancel" + TurnOnPC
const Msg_Exec_CancelCloseWindows_cmd string = "shutdown -a" const Msg_Exec_CancelTurnOffPC_cmd string = "shutdown -a"
const Msg_Exec_LogOffUser string = "logoffuser" const Msg_Exec_LogOffUser string = LogOutUser
const Msg_Exec_LogOffUser_cmd string = "shutdown -l" const Msg_Exec_LogOffUser_cmd string = "shutdown -l"
const Msg_Exec_UserExec string = "userexec" const Msg_Exec_UserExec string = "userexec"
const Msg_Exec_RebootWindows string = "rebootWindows" const Msg_Exec_RebootWindows string = "rebootWindows"
const Msg_Exec_RebootWindows_cmd string = "shutdown -r -t 15" const Msg_Exec_RebootWindows_cmd string = "shutdown -r -t 15"
const Msg_Exec_UpdateVersion string = "updateverion"
const Msg_Exec_UpdateVersion_cmd string = "Env_ADSoftTool_Update"
const Msg_Exec_InstallSoftware string = "installsoftware" const Msg_Exec_InstallSoftware string = "installsoftware"
const Msg_Exec_CopyWeDrive string = "copyWeDrive" const Msg_Exec_CopyWeDrive string = "copyWeDrive"
const Msg_Exec_CopyDeptShare string = "copydeptshare" const Msg_Exec_CopyDeptShare string = "copydeptshare"
...@@ -138,11 +151,9 @@ func GJreport(s string,who string) interface{}{ ...@@ -138,11 +151,9 @@ func GJreport(s string,who string) interface{}{
var rep MJreport var rep MJreport
rep.init(s) rep.init(s)
if who != "" { rep.Username = who } if who != "" { rep.Username = who }
return rep return rep
} }
func (rep * MJreport)init(Report string) { func (rep * MJreport)init(Report string) {
rep.Username = User_name rep.Username = User_name
rep.Dept = User_dept rep.Dept = User_dept
rep.Timestamp = NowTimestamp() rep.Timestamp = NowTimestamp()
...@@ -151,7 +162,13 @@ func (rep * MJreport)init(Report string) { ...@@ -151,7 +162,13 @@ func (rep * MJreport)init(Report string) {
rep.Instruction = Report rep.Instruction = Report
rep.Version = Version rep.Version = Version
} }
func (rep * MJreport)Reg_Write_Key_one_AC(key , value string){
Reg_Write_key_one(
Reg_Root_ac,
Reg_Path_home_ac + rep.Computername,
key,
value)
}
// Exec // Exec
......
...@@ -201,3 +201,12 @@ func Adserver() bool{ ...@@ -201,3 +201,12 @@ func Adserver() bool{
if Host_adserver == User_computername {return true} if Host_adserver == User_computername {return true}
return false return false
} }
func HostnameToUsername(hostname * string)string {
if strings.HasSuffix(*hostname,"-PC$") {
return Reg_query_key_one(
Reg_Root_ac,
Reg_Path_home_ac + *hostname,
Reg_Name_LoginTime)
}
return *hostname
}
\ No newline at end of file
...@@ -184,7 +184,7 @@ func Reg_Write_key_one(root int, path, name, value string) { ...@@ -184,7 +184,7 @@ func Reg_Write_key_one(root int, path, name, value string) {
// //
// //
// regedit ext // reg func for domain computer
// //
func Reg_Write_DC(key , value string){ func Reg_Write_DC(key , value string){
Reg_Write_key_one( Reg_Write_key_one(
......
package main package main
import ( import (
"github.com/lxn/walk" "github.com/lxn/walk"
"AD-Control/public" pub "AD-Control/public"
) )
...@@ -19,14 +19,14 @@ func menuInitPower(ni * walk.NotifyIcon){ ...@@ -19,14 +19,14 @@ func menuInitPower(ni * walk.NotifyIcon){
// 建立空菜单 // 建立空菜单
nm,err := walk.NewMenu() nm,err := walk.NewMenu()
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
for i,buttonText := range sub{ for i,buttonText := range sub{
// 建立 子按钮 // 建立 子按钮
na := walk.NewAction() na := walk.NewAction()
if err := na.SetText(buttonText); err != nil { if err := na.SetText(buttonText); err != nil {
public.PntError(err) pub.PntError(err)
} }
// 为子按钮 添加事件 // 为子按钮 添加事件
...@@ -50,7 +50,7 @@ func menuInitPower(ni * walk.NotifyIcon){ ...@@ -50,7 +50,7 @@ func menuInitPower(ni * walk.NotifyIcon){
//将菜单添加到托盘 //将菜单添加到托盘
sysmenu,err := ni.ContextMenu().Actions().AddMenu(nm) sysmenu,err := ni.ContextMenu().Actions().AddMenu(nm)
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
// 主菜单 属性 // 主菜单 属性
...@@ -60,26 +60,26 @@ func menuInitPower(ni * walk.NotifyIcon){ ...@@ -60,26 +60,26 @@ func menuInitPower(ni * walk.NotifyIcon){
} }
// 电源管理 下班 // 电源管理 下班
func pWorkOff(){ func pWorkOff(){
public.SendServerReport(public.Msg_Report_Offwork) pub.SendServerReport(pub.Msg_Report_Offwork)
} }
// 电源管理 关机 // 电源管理 关机
func pCloseWindows(){ func pCloseWindows(){
public.SendServerExec(public.Msg_Exec_CloseWindows) pub.SendServerExec(pub.Msg_Exec_TurnOffPC)
} }
// 电源管理 注销用户 // 电源管理 注销用户
func pLogOffUser(){ func pLogOffUser(){
public.SendServerExec(public.Msg_Exec_LogOffUser) pub.SendServerExec(pub.Msg_Exec_LogOffUser)
} }
// 电源管理 重启主机 // 电源管理 重启主机
func pRebootWindows(){ func pRebootWindows(){
public.SendServerExec(public.Msg_Exec_RebootWindows) pub.SendServerExec(pub.Msg_Exec_RebootWindows)
} }
// 电源管理 取消自动关机 // 电源管理 取消自动关机
func pCancelCloseWindows(){ func pCancelCloseWindows(){
public.SendServerExec(public.Msg_Exec_CancelCloseWindows) pub.SendServerExec(pub.Msg_Exec_CancelTurnOffPC)
} }
...@@ -95,23 +95,23 @@ func menuInitSoftwareInstall(ni * walk.NotifyIcon){ ...@@ -95,23 +95,23 @@ func menuInitSoftwareInstall(ni * walk.NotifyIcon){
// 建立空菜单 // 建立空菜单
nm,err := walk.NewMenu() nm,err := walk.NewMenu()
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
list,err := public.ReadDir(public.SMB_ADSoftlike) list,err := pub.ReadDir(pub.SMB_ADSoftlike)
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
for _,ueach := range list{ for _,ueach := range list{
each := ueach.Name() each := ueach.Name()
if each == ".DS_Store"{ if each == ".DS_Store"{
continue continue
} }
each_noext := public.TrimSuffix(public.TrimSuffix(ueach.Name(),".exe"),".msi") each_noext := pub.TrimSuffix(pub.TrimSuffix(ueach.Name(),".exe"),".msi")
// 建立 子按钮 // 建立 子按钮
na := walk.NewAction() na := walk.NewAction()
if err := na.SetText(each_noext); err != nil { if err := na.SetText(each_noext); err != nil {
public.PntError(err) pub.PntError(err)
} }
// 为子按钮 添加事件 // 为子按钮 添加事件
...@@ -125,7 +125,7 @@ func menuInitSoftwareInstall(ni * walk.NotifyIcon){ ...@@ -125,7 +125,7 @@ func menuInitSoftwareInstall(ni * walk.NotifyIcon){
//将菜单添加到托盘 //将菜单添加到托盘
sysmenu,err := ni.ContextMenu().Actions().AddMenu(nm) sysmenu,err := ni.ContextMenu().Actions().AddMenu(nm)
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
// 主菜单 属性 // 主菜单 属性
...@@ -135,9 +135,9 @@ func menuInitSoftwareInstall(ni * walk.NotifyIcon){ ...@@ -135,9 +135,9 @@ func menuInitSoftwareInstall(ni * walk.NotifyIcon){
} }
// 软件安装 进行安装 // 软件安装 进行安装
func siEnter_admin(softname string){ func siEnter_admin(softname string){
go public.Msg("等待弹出安装窗口,请稍等。。") go pub.Msg("等待弹出安装窗口,请稍等。。")
ifFile := public.Exist(`C:\windows\`+softname) ifFile := pub.Exist(`C:\windows\`+softname)
public.SendServer(public.GJexecInstallSoftware(ifFile,softname)) pub.SendServer(pub.GJexecInstallSoftware(ifFile,softname))
} }
...@@ -155,14 +155,14 @@ func menuInitWxDriveSync(ni * walk.NotifyIcon){ ...@@ -155,14 +155,14 @@ func menuInitWxDriveSync(ni * walk.NotifyIcon){
// 建立空菜单 // 建立空菜单
nm,err := walk.NewMenu() nm,err := walk.NewMenu()
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
for i,buttonText := range sub{ for i,buttonText := range sub{
// 建立 子按钮 // 建立 子按钮
na := walk.NewAction() na := walk.NewAction()
if err := na.SetText(buttonText); err != nil { if err := na.SetText(buttonText); err != nil {
public.PntError(err) pub.PntError(err)
} }
// 为子按钮 添加事件 // 为子按钮 添加事件
...@@ -185,7 +185,7 @@ func menuInitWxDriveSync(ni * walk.NotifyIcon){ ...@@ -185,7 +185,7 @@ func menuInitWxDriveSync(ni * walk.NotifyIcon){
//将菜单添加到托盘 //将菜单添加到托盘
sysmenu,err := ni.ContextMenu().Actions().AddMenu(nm) sysmenu,err := ni.ContextMenu().Actions().AddMenu(nm)
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
// 主菜单 属性 // 主菜单 属性
...@@ -197,45 +197,45 @@ func menuInitWxDriveSync(ni * walk.NotifyIcon){ ...@@ -197,45 +197,45 @@ func menuInitWxDriveSync(ni * walk.NotifyIcon){
func wxdsInit(){ func wxdsInit(){
explain := "选择个人ID(一般是168开头),请根据微盘的文件夹所在位置进行选择,确定并选择并点击文件夹(一串数字)后,点击确定继续进行下一步!具体操作方法点击说明!" explain := "选择个人ID(一般是168开头),请根据微盘的文件夹所在位置进行选择,确定并选择并点击文件夹(一串数字)后,点击确定继续进行下一步!具体操作方法点击说明!"
var FullWeDrive string var FullWeDrive string
for _,i := range public.Dir_WeDrive{ for _,i := range pub.Dir_WeDrive{
if public.Exist(i + `\Global`){ if pub.Exist(i + `\Global`){
FullWeDrive = public.ChooseFolder(&explain,&i)+`\WeDrive\知微数据` FullWeDrive = pub.ChooseFolder(&explain,&i)+`\WeDrive\知微数据`
continue continue
} }
} }
public.PntInfo(FullWeDrive) pub.PntInfo(FullWeDrive)
if public.NotExist(FullWeDrive){ if pub.NotExist(FullWeDrive){
public.Msg("不存在知微数据文件夹,请重新选择") pub.Msg("不存在知微数据文件夹,请重新选择")
return return
} }
public.Reg_Write_DC( pub.Reg_Write_DC(
public.Reg_Name_WeDriveDir, pub.Reg_Name_WeDriveDir,
FullWeDrive) FullWeDrive)
public.Msg("初始化完毕,请在微盘中创建文件夹(办公室部门内部共享),并分享给同事,创建后,点击开始同步即可。") pub.Msg("初始化完毕,请在微盘中创建文件夹(办公室部门内部共享),并分享给同事,创建后,点击开始同步即可。")
} }
// 微盘同步 同步到微盘 // 微盘同步 同步到微盘
func wxdsToDrive(){ func wxdsToDrive(){
if public.Msg_YesNo("确定手动进行一次 -> 从共享盘同步到微盘吗?如果调整过共享盘的文件结构,请先在微盘中同步调整,否则微盘将会混沌。")==1{ if pub.Msg_YesNo("确定手动进行一次 -> 从共享盘同步到微盘吗?如果调整过共享盘的文件结构,请先在微盘中同步调整,否则微盘将会混沌。")==1{
public.SendServer(public.GJexecCopyWeDrive(public.Msg_Exec_CopyWeDrive)) pub.SendServer(pub.GJexecCopyWeDrive(pub.Msg_Exec_CopyWeDrive))
public.Msg("同步完成!") pub.Msg("同步完成!")
} }
} }
// 微盘同步 同步到服务器 // 微盘同步 同步到服务器
func wxdsToServer(){ func wxdsToServer(){
reg_Value_WeDriveDir := public.Reg_Query_DC(public.Reg_Name_WeDriveDir) reg_Value_WeDriveDir := pub.Reg_Query_DC(pub.Reg_Name_WeDriveDir)
weDrive_Share_Dir := reg_Value_WeDriveDir +`\` + public.Dir_dept_share weDrive_Share_Dir := reg_Value_WeDriveDir +`\` + pub.Dir_dept_share
if reg_Value_WeDriveDir != "" && public.Exist(weDrive_Share_Dir){ if reg_Value_WeDriveDir != "" && pub.Exist(weDrive_Share_Dir){
if public.Msg_YesNo("确定手动进行一次 -> 从微盘到共享盘吗?如果俩者文件结构不一致,文件盘将会混沌。")==1{ if pub.Msg_YesNo("确定手动进行一次 -> 从微盘到共享盘吗?如果俩者文件结构不一致,文件盘将会混沌。")==1{
cmd := `cmd /c xcopy ` + weDrive_Share_Dir + public.SMB_ADMainDeptShare + "/D /S /E /C /y" cmd := `cmd /c xcopy ` + weDrive_Share_Dir + pub.SMB_ADMainDeptShare + "/D /S /E /C /y"
public.Execcmd_wait(cmd) pub.Execcmd_wait(cmd)
public.SendServerReport(public.Msg_Report_OverCopyToDeptShare) pub.SendServerReport(pub.Msg_Report_OverCopyToDeptShare)
public.Msg("同步完成!") pub.Msg("同步完成!")
} }
}else{ }else{
public.Msg("未进行初始化或当前微盘路径错误,请重新初始化。微盘路径信息:"+reg_Value_WeDriveDir) pub.Msg("未进行初始化或当前微盘路径错误,请重新初始化。微盘路径信息:"+reg_Value_WeDriveDir)
} }
} }
...@@ -254,7 +254,7 @@ func wxdsExplain(){ ...@@ -254,7 +254,7 @@ func wxdsExplain(){
8.以上,此致,敬礼,望赞! 8.以上,此致,敬礼,望赞!
` `
public.Msg(msg) pub.Msg(msg)
} }
...@@ -273,7 +273,7 @@ func menuInitTools(ni * walk.NotifyIcon){ ...@@ -273,7 +273,7 @@ func menuInitTools(ni * walk.NotifyIcon){
// 建立空菜单 // 建立空菜单
nm,err := walk.NewMenu() nm,err := walk.NewMenu()
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
lastone := len(sub)-1 lastone := len(sub)-1
for i,buttonText := range sub{ for i,buttonText := range sub{
...@@ -281,18 +281,18 @@ func menuInitTools(ni * walk.NotifyIcon){ ...@@ -281,18 +281,18 @@ func menuInitTools(ni * walk.NotifyIcon){
// 过滤按钮 // 过滤按钮
switch i{ switch i{
case lastone-2: case lastone-2:
if ! public.TheUser(public.AD_User_huyibo) {continue} if ! pub.TheUser(pub.AD_User_huyibo) {continue}
case lastone-1: case lastone-1:
if ! public.TheUser(public.AD_User_xuwenqiang) {continue} if ! pub.TheUser(pub.AD_User_xuwenqiang) {continue}
case lastone: case lastone:
if ! public.AdminUser() {continue} if ! pub.AdminUser() {continue}
} }
// 建立 子按钮 // 建立 子按钮
na := walk.NewAction() na := walk.NewAction()
if err := na.SetText(buttonText); err != nil { if err := na.SetText(buttonText); err != nil {
public.PntError(err) pub.PntError(err)
} }
// 为子按钮 添加事件 // 为子按钮 添加事件
...@@ -323,7 +323,7 @@ func menuInitTools(ni * walk.NotifyIcon){ ...@@ -323,7 +323,7 @@ func menuInitTools(ni * walk.NotifyIcon){
//将菜单添加到托盘 //将菜单添加到托盘
sysmenu,err := ni.ContextMenu().Actions().AddMenu(nm) sysmenu,err := ni.ContextMenu().Actions().AddMenu(nm)
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
// 主菜单 属性 // 主菜单 属性
...@@ -334,32 +334,32 @@ func menuInitTools(ni * walk.NotifyIcon){ ...@@ -334,32 +334,32 @@ func menuInitTools(ni * walk.NotifyIcon){
} }
// 其他工具 Excel关键词分割器 // 其他工具 Excel关键词分割器
func tMultiSplit(){ func tMultiSplit(){
public.Execcmd_nowait(public.Cmd_K_Start + public.App_MultiSplit) pub.Execcmd_nowait(pub.Cmd_K_Start + pub.App_MultiSplit)
} }
func tBakcupUser(){ func tBakcupUser(){
if public.Msg_YesNo("是否执行一次手动备份用户文件夹。目标文件夹:"+public.User_profile)==1{ if pub.Msg_YesNo("是否执行一次手动备份用户文件夹。目标文件夹:"+pub.User_profile)==1{
public.SendServer(public.GJreport(public.Msg_Report_StartBak,public.User_name)) pub.SendServer(pub.GJreport(pub.Msg_Report_StartBak,pub.User_name))
} }
} }
// 其他工具 移动硬盘(胡一波专用) // 其他工具 移动硬盘(胡一波专用)
func t_movedisk_huyibo(){ func t_movedisk_huyibo(){
public.SendDaemonExec(`F:\SamsungPortableSSD.exe`) pub.SendDaemonExec(`F:\SamsungPortableSSD.exe`)
} }
func t_keyboard_xuwenqiang(){ func t_keyboard_xuwenqiang(){
public.SendServerGUIExec(`start C:\Users\Public\Desktop\Durgod_Zeus_Engine.lnk`) pub.SendServerGUIExec(`start C:\Users\Public\Desktop\Durgod_Zeus_Engine.lnk`)
} }
// 其他工具 隐藏图标 // 其他工具 隐藏图标
func tHideIcon(){ func tHideIcon(){
public.Msg("emmmmmmm,大概下周吧,这周无望哈") pub.Msg("emmmmmmm,大概下周吧,这周无望哈")
} }
// 其他工具 显示图标 // 其他工具 显示图标
func tShowIcon(){ func tShowIcon(){
public.Msg("仅供参考!!") pub.Msg("仅供参考!!")
} }
// 其他工具 测试 // 其他工具 测试
func tTest(){ func tTest(){
//public.SendDaemonExec(`D:\WXWork.exe`) //pub.SendDaemonExec(`D:\WXWork.exe`)
} }
...@@ -376,48 +376,48 @@ func menuInitFileShares(ni * walk.NotifyIcon){ ...@@ -376,48 +376,48 @@ func menuInitFileShares(ni * walk.NotifyIcon){
// // 建立空菜单 // // 建立空菜单
mfs,err := walk.NewMenu() mfs,err := walk.NewMenu()
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
// 说明:添加 域用户 文件共享 // 说明:添加 域用户 文件共享
// 方法:列举目录名,生成菜单 // 方法:列举目录名,生成菜单
// 其次,列举额目录中的名单作为按钮添加到菜单 // 其次,列举额目录中的名单作为按钮添加到菜单
deptList,err := public.ReadDir(public.SMB_ADMain) deptList,err := pub.ReadDir(pub.SMB_ADMain)
if err !=nil { if err !=nil {
public.PntError(err) pub.PntError(err)
} }
for _,memberList := range deptList { for _,memberList := range deptList {
nm,err := walk.NewMenu() nm,err := walk.NewMenu()
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
deptshare := memberList.Name() deptshare := memberList.Name()
// 不在 其他共享 里 显示自己部门的共享 // 不在 其他共享 里 显示自己部门的共享
if deptshare == public.SMB_ADMainDept{ if deptshare == pub.SMB_ADMainDept{
continue continue
} }
member,err := public.ReadDir(public.SMB_ADMain + `\` + deptshare) member,err := pub.ReadDir(pub.SMB_ADMain + `\` + deptshare)
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
for _,mem := range member{ for _,mem := range member{
wokrer := mem.Name() wokrer := mem.Name()
// 建立 子按钮 // 建立 子按钮
na := walk.NewAction() na := walk.NewAction()
if err := na.SetText(public.TrimSuffix(wokrer,".lnk")); err != nil { if err := na.SetText(pub.TrimSuffix(wokrer,".lnk")); err != nil {
public.PntError(err) pub.PntError(err)
} }
// 为子按钮 添加事件 // 为子按钮 添加事件
na.Triggered().Attach(func(){public.OpenWindow(public.SMB_ADMain + `\` + deptshare + `\` + wokrer);return}) na.Triggered().Attach(func(){pub.OpenWindow(pub.SMB_ADMain + `\` + deptshare + `\` + wokrer);return})
// 将 子按钮 添加到 菜单 // 将 子按钮 添加到 菜单
nm.Actions().Add(na) nm.Actions().Add(na)
} }
if m,err := mfs.Actions().AddMenu(nm);err != nil{ if m,err := mfs.Actions().AddMenu(nm);err != nil{
public.PntError(err) pub.PntError(err)
}else{ }else{
m.SetText(deptshare) m.SetText(deptshare)
m.SetVisible(true) m.SetVisible(true)
...@@ -429,19 +429,19 @@ func menuInitFileShares(ni * walk.NotifyIcon){ ...@@ -429,19 +429,19 @@ func menuInitFileShares(ni * walk.NotifyIcon){
// 添加 // 添加
na := walk.NewAction() na := walk.NewAction()
if err := na.SetText("会议室的大脸机"); err != nil { if err := na.SetText("会议室的大脸机"); err != nil {
public.PntError(err) pub.PntError(err)
}else{ }else{
//将菜单添加到托盘 //将菜单添加到托盘
na.Triggered().Attach(func(){public.OpenWindow(`ftp://adserver`)}) na.Triggered().Attach(func(){pub.OpenWindow(`ftp://adserver`)})
if err := mfs.Actions().Add(na);err != nil{ if err := mfs.Actions().Add(na);err != nil{
public.PntError(err) pub.PntError(err)
} }
} }
//将菜单添加到托盘 //将菜单添加到托盘
sysmenu,err := ni.ContextMenu().Actions().AddMenu(mfs) sysmenu,err := ni.ContextMenu().Actions().AddMenu(mfs)
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
// 主菜单 属性 // 主菜单 属性
sysmenu.SetText(fa) sysmenu.SetText(fa)
...@@ -464,12 +464,12 @@ func menuInitMyShares(ni * walk.NotifyIcon){ ...@@ -464,12 +464,12 @@ func menuInitMyShares(ni * walk.NotifyIcon){
// 建立空菜单 // 建立空菜单
nm,err2 := walk.NewMenu() nm,err2 := walk.NewMenu()
if err2 !=nil { if err2 !=nil {
public.PntError(err2) pub.PntError(err2)
} }
// 读取我的部门共享目录 // 读取我的部门共享目录
deptList,err3 := public.ReadDir(public.SMB_ADMainDept) deptList,err3 := pub.ReadDir(pub.SMB_ADMainDept)
if err3 !=nil { if err3 !=nil {
public.PntError(err3) pub.PntError(err3)
} }
for _,mem := range deptList{ for _,mem := range deptList{
...@@ -477,12 +477,12 @@ func menuInitMyShares(ni * walk.NotifyIcon){ ...@@ -477,12 +477,12 @@ func menuInitMyShares(ni * walk.NotifyIcon){
// 建立 子按钮 // 建立 子按钮
na := walk.NewAction() na := walk.NewAction()
if err := na.SetText(public.TrimSuffix(wokrer,".lnk")); err != nil { if err := na.SetText(pub.TrimSuffix(wokrer,".lnk")); err != nil {
public.PntError(err) pub.PntError(err)
} }
// 为子按钮 添加事件 // 为子按钮 添加事件
na.Triggered().Attach(func(){public.OpenWindow(public.SMB_ADMainDept +`\`+ wokrer);return}) na.Triggered().Attach(func(){pub.OpenWindow(pub.SMB_ADMainDept +`\`+ wokrer);return})
// 将 子按钮 添加到 菜单 // 将 子按钮 添加到 菜单
nm.Actions().Add(na) nm.Actions().Add(na)
...@@ -491,7 +491,7 @@ func menuInitMyShares(ni * walk.NotifyIcon){ ...@@ -491,7 +491,7 @@ func menuInitMyShares(ni * walk.NotifyIcon){
//将菜单添加到托盘 //将菜单添加到托盘
sysmenu,err := ni.ContextMenu().Actions().AddMenu(nm) sysmenu,err := ni.ContextMenu().Actions().AddMenu(nm)
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
// 主菜单 属性 // 主菜单 属性
......
No preview for this file type
...@@ -2,41 +2,37 @@ package main ...@@ -2,41 +2,37 @@ package main
import ( import (
"github.com/lxn/walk" "github.com/lxn/walk"
"AD-Control/public" pub "AD-Control/public"
) )
func userInit() string{ func userInit() string{
public.Loger = public.NewLoger(public.User_appdata+ `\users.log`) pub.Loger = pub.NewLoger(pub.User_appdata+ `\users.log`)
public.Reg_Exist_item(public.HKCU,public.Reg_Path_home) pub.Reg_Exist_item(pub.HKCU,pub.Reg_Path_home)
// 微盘备份步骤 // 微盘备份步骤
if public.Reg_Value_WeDriveDir != ""{ if pub.Reg_Value_WeDriveDir != ""{
// && public.Exist(public.Dir_dept_share_full) // && pub.Exist(pub.Dir_dept_share_full)
// 如果微盘的文件夹存在 // 如果微盘的文件夹存在
// 则,重复执行 // 则,重复执行
// 随机延迟300s,进行复制,固定延迟2h // 随机延迟300s,进行复制,固定延迟2h
go func (){ go func (){
for{ for{
public.RandDelay(300) pub.RandDelay(300)
public.SendServer(public.GJexecCopyWeDrive(public.Msg_Exec_CopyWeDrive)) pub.SendServer(pub.GJexecCopyWeDrive(pub.Msg_Exec_CopyWeDrive))
public.Delay(7200) pub.Delay(7200)
} }
}() }()
}else{
wxdsInit()
} }
// 初始化 图标文件 // 初始化 图标文件
var icoDir =[]string {`AD-Control.ico`,`C:\windows\system32\AD-Control.ico`,`C:\Users\Public\Documents\AD-Control\AD-Control.ico`} var icoDir =[]string {`AD-Control.ico`,`C:\windows\system32\AD-Control.ico`,`C:\Users\Public\Documents\AD-Control\AD-Control.ico`}
for _,i := range icoDir{ for _,i := range icoDir{
if public.Exist(i){ if pub.Exist(i){
return i return i
} }
} }
public.SendServerError("no icon file") pub.SendServerError("no icon file")
return "" return ""
} }
...@@ -57,27 +53,27 @@ func main() { ...@@ -57,27 +53,27 @@ func main() {
// 程序初始化 // 程序初始化
mw,err := walk.NewMainWindow() mw,err := walk.NewMainWindow()
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
icon, err := walk.Resources.Icon(icodir) icon, err := walk.Resources.Icon(icodir)
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
// 后台图标应用初始化 // 后台图标应用初始化
ni, err := walk.NewNotifyIcon(mw) ni, err := walk.NewNotifyIcon(mw)
if err != nil { if err != nil {
public.PntError(err) pub.PntError(err)
} }
defer ni.Dispose() defer ni.Dispose()
// Set the icon and a tool tip text. // Set the icon and a tool tip text.
if err := ni.SetIcon(icon); err != nil { if err := ni.SetIcon(icon); err != nil {
public.PntError(err) pub.PntError(err)
} }
if err := ni.SetToolTip("Click for info or use the context menu to exit."); err != nil { if err := ni.SetToolTip("Click for info or use the context menu to exit."); err != nil {
public.PntError(err) pub.PntError(err)
} }
menuInit(ni) menuInit(ni)
...@@ -85,11 +81,11 @@ func main() { ...@@ -85,11 +81,11 @@ func main() {
// 域计算机运行users.exe失败, // 域计算机运行users.exe失败,
// 需要取消由users.exe向ADServer报告 // 需要取消由users.exe向ADServer报告
// 交给组策略中adct.exe进行报告 // 交给组策略中adct.exe进行报告
// public.SendServerReport(public.Msg_Report_UserStart) // pub.SendServerReport(pub.Msg_Report_UserStart)
// The notify icon is hidden initially, so we have to make it visible. // The notify icon is hidden initially, so we have to make it visible.
if err := ni.SetVisible(true); err != nil { if err := ni.SetVisible(true); err != nil {
public.PntError(err) pub.PntError(err)
} }
// 循环 运行窗体 // 循环 运行窗体
......
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