短信群发单体版v2

#NoTrayIcon ;不显示图标
FileInstall, org.myklos.sendmessage.apk, 网关服务器.apk ;打包文件
;创建界面
Gui, Add, Text, x6 y7 w140 h50 , 短信网关地址`n例192.168.42.129:8080`n一行一个
Gui, Add, Edit, x6 y57 w140 h80 vgate, 192.168.42.129:8080
Gui, Add, CheckBox, x6 y137 w140 h20 vlog, 记录发送记录到文件
Gui, Add, CheckBox, x6 y157 w140 h20 vslow, 慢速发送
Gui, Add, Text, x146 y7 w100 h20 , 发送号码
Gui, Add, Edit, x146 y27 w100 h150 vhm
Gui, Add, Text, x246 y7 w370 h20 , 短信内容
Gui, Add, Edit, x246 y27 w370 h150 vnr
Gui, Add, Text, x6 y177 w240 h60 vshow
Gui, Add, Button, x246 y177 w370 h60 gsend, 开始发送
Gui, Show,h246 w626, 群发短信单体版

;检查是否使用过 加载上次填写的服务器地址
IfExist, gate.ini
	{
	FileRead, gate, gate.ini
	GuiControl, , gate, %gate%
	}


;转码函数
urlencode(string){
clip := ClipboardAll ;剪切板转存
Clipboard = %string%
Transform, string, Unicode ;获取UTF-8
Clipboard := clip
StringLen, len, string
SetFormat, IntegerFast, hex ;运算结果为HEX
Loop
{
if A_Index > %len%
	Break
StringMid, out, string, %A_Index%, 1
hex := Asc(out) ;获取单字节ascii值
hex := hex * 0x01
StringReplace, hex, hex, 0x, , All
content = %content%`%%hex%
}
SetFormat, IntegerFast, d ;运算结果为是静止
Return content
}

Return

Send:
;从界面取回内容
GuiControlGet, hm
GuiControlGet, nr
GuiControlGet, gate
GuiControlGet, log
GuiControlGet, slow
;处理填写内容
IfNotInString, hm, `n
	{
	number0 = 1
	number1 = %hm%
	}
Else
	{
	StringReplace, hm, hm, `r, , All
	hm = %hm%`n
	StringReplace, hm, hm, `n`n, , All
	StringSplit, number, hm, `n
	}
IfNotInString, gate, `n
	{
	gate0 = 1
	gate1 = %gate%
	}
Else
	{
	StringReplace, gate, gate, `r, , All
	gate = %gate%`n
	StringReplace, gate, gate, `n`n, , All
	StringSplit, gate, gate, `n
	}
;初始化
id = 0
success = 0
time = %A_Now%
data := urlencode(nr) ;urlencode
Loop
{
if A_Index > %number0%
	Break
tmpnumber = % number%A_Index%
if tmpnumber 
	{
	StringReplace, tmpnumber, tmpnumber, -, , All
	b := tmpnumber/1
	IfInString, b, .000000
		{
		id += 1
		if id > %gate0%
			id = 1
		host = % gate%id%
		pass =  ; //密码
		GuiControl, , show, 网关:%host%`n号码:%tmpnumber%`n序号:%A_Index%`n ;显示
		URLDownloadToFile, http://%host%/send/?pass=%pass%&number=%tmpnumber%&data=%data%&submit=&id=, %A_Temp%send.tmp ;执行并抓回结果
		FileRead, result, %A_Temp%send.tmp
		StringSplit, result, result, `n  ; //分割结果
		StringReplace, status, result1, STATUS:%A_Space%, ,
		GuiControl, , show, 网关:%host%`n号码:%tmpnumber%`n序号:%A_Index%`n状态:%status%
		if status = STATUS_OK
			success += 1
		if log = 1
			FileAppend, 网关:%host%`,号码:%tmpnumber%`,序号:%A_Index%`,状态:%status%`,时间:%A_Now%`n, %time%.log
		if slow = 1
			sleep, 1000
		;Else
			;sleep, 100
		}
	}
}
GuiControl, , show, 共计发送%number0%条短信,其中成功%success%个!
FileDelete, gate.ini
FileAppend, %gate%, gate.ini
Return

GuiClose:
ExitApp

给TA捐赠
共{{data.count}}人
人已捐赠
其他

直接调用系统shell32.dll获取图标,也可以自已选文件

2020-3-9 4:31:44

其他案例

示例

2020-3-9 4:33:44

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索