📄 web_main.pas
字号:
end;
end;
procedure TForm1.N6Click(Sender: TObject);
var i:integer;
no_temp,no_temp7:string;
begin
while memo1.Lines.Count>0 do
begin
i:= no_y.IndexOf(memo1.Lines.Strings[0]);
if i>-1 then
begin
no_temp:=memo1.Lines.Strings[0];
no_temp7:=leftstr(no_temp,7);
if memo1.Lines.Count>0 then memo1.Lines.Delete(0);
//no_y.Delete(i);
while (leftstr(no_y.Strings[i],7)=no_temp7) do
begin
no_tc.Add(no_y.Strings[i]);
no_y.Delete(i);
if no_y.Count<=i then
begin
memo2.Clear;
StatusBar1.Panels.Items[0].Text:='剔除后,数量:'+inttostr(no_y.Count);
showmessage('剔除号码数量:'+inttostr(no_tc.Count)+',请保存');
if SaveDialog1.Execute then
begin
if trim(Memo3.Text)<>'' then no_tc.Insert(0,Memo3.Text);
no_tc.SaveToFile(SaveDialog1.FileName);
end ;
exit;
end;
StatusBar1.Panels.Items[0].Text:='剔除后,数量:'+inttostr(no_y.Count);
Application.ProcessMessages;
end;
end;
end;
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
Form1.Left:=100;
Form1.Top:=100;
end;
procedure TForm1.N8Click(Sender: TObject);
var
path_str:string;
no_list_temp:TStringList;
begin
if OpenDialog1.Execute then
begin
path_str:=OpenDialog1.FileName;
if FileExists(path_str) then
begin
no_list_temp:=TStringList.Create;
no_list_temp:=inport_no(path_str);
if no_list_temp.Count>0 then
begin
memo3.Clear;
if not is_int(no_list_temp.Strings[0]) then
begin
memo3.Lines.Add(no_list_temp.Strings[0]);
no_list_temp.Delete(0);
end;
no_y.DelimitedText:=no_list_temp.DelimitedText;
Application.ProcessMessages;
StatusBar1.Panels.Items[0].Text:='导入号码:'+inttostr(no_y.Count);
end;
end;
end;
end;
procedure TForm1.N9Click(Sender: TObject);
var
F:TextFile;
s,path_str:string;
s1:widestring;
begin
if OpenDialog1.Execute then
begin
path_str:=OpenDialog1.FileName;
if FileExists(path_str) then
begin
AssignFile(F,path_str);
Reset(F);
while not Eof(F) do
begin
Readln(F,s);
s:=trim(s);
s1:=trim(s);
Application.ProcessMessages; //and (length(s)=length(s1))
if (Trim(s)<>'') and (length(s)=length(s1)) then no_y.Add(Trim(s));
StatusBar1.Panels.Items[0].Text:='导入号码:'+inttostr(no_y.Count);
end;
CloseFile(F);
end;
end;
end;
procedure TForm1.q1Click(Sender: TObject);
begin
no_y.Clear;
end;
procedure TForm1.N10Click(Sender: TObject);
var
no_list_temp:TStringList;
iii:integer;
begin
no_list_temp:=TStringList.Create;
for iii:=0 to 2 do
begin
no_list_temp.Clear;
while no_y.Count>0 do
begin
no_list_temp.Add(no_y.Strings[0]);
no_y.Delete(0);
if no_y.Count> 0 then
begin
no_list_temp.Add(no_y.Strings[no_y.Count-1]);
no_y.Delete(no_y.Count-1);
end;
Application.ProcessMessages;
StatusBar1.Panels.Items[1].Text:='乱序'+inttostr(iii)+',进度:'+inttostr(no_list_temp.Count);
end;
no_y.Clear;
no_y.DelimitedText:=no_list_temp.DelimitedText;
end;
no_list_temp.Free;
StatusBar1.Panels.Items[1].Text:='已乱序,号码数量:'+inttostr(no_y.Count);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
StatusBar1.Panels.Items[0].Text:='当前号码数量:'+inttostr(no_y.Count);
StatusBar1.Panels.Items[1].Text:='插入字符数量:'+inttostr(all_bd.Count);
end;
procedure TForm1.N12Click(Sender: TObject);
var i:integer;
str_temp1,str_temp2:string;
begin
memo4.Clear;
N2.Click ;
for i:=0 to no_y.Count-2 do
begin
str_temp1:=trim(no_y.Strings[i]);
str_temp2:=trim(no_y.Strings[i+1]);
if str_temp1=str_temp2 then
begin
memo4.Lines.Add(str_temp1);
end;
StatusBar1.Panels.Items[1].Text:='查找号码中:'+inttostr(i);
Application.ProcessMessages;
end;
N3.Click;
N11111.Click;
end;
procedure TForm1.N13Click(Sender: TObject);
var str_temp:string;
begin
if SaveDialog1.Execute then
begin
if memo4.Lines.Count>2 then
begin
str_temp:=memo4.Lines.DelimitedText;
memo4.Clear;
memo4.Lines.Add(str_temp) ;
memo4.Lines.SaveToFile(SaveDialog1.FileName);
memo4.Clear;
// memo4.Lines.DelimitedText:=str_temp;
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
no_list_temp:TStringList;
begin
no_list_temp:=TStringList.Create;
no_list_temp.Sorted:=true;
no_list_temp.DelimitedText:=memo4.Lines.DelimitedText;
memo4.Clear;
memo4.Lines.DelimitedText:=no_list_temp.DelimitedText;
no_list_temp.Free;
StatusBar1.Panels.Items[1].Text:='已消除重号,号码数量:'+inttostr(memo4.Lines.Count);
end;
procedure TForm1.Button2Click(Sender: TObject);
var i,it_no_y:integer;
no_list_temp:TStringList;
begin
it_no_y:=(no_y.Count div strtoint(edit1.Text));
if Messagebox(Handle,pchar('你确定剔除'+inttostr(it_no_y)+'个号码吗?'),'提示',MB_YESNO+MB_ICONQUESTION+MB_DEFBUTTON2)=IDYES then
begin
no_list_temp:=TStringList.Create;
i:=1;
while i<no_y.Count-1 do
begin
if (i mod strtoint(edit1.Text)=0) then
begin
no_list_temp.Add(no_y.Strings[i-1]);
no_y.Strings[i-1]:='';
Application.ProcessMessages;
StatusBar1.Panels.Items[0].Text:='剔除号码中:'+inttostr(no_list_temp.Count);
end;
inc(i,1);
end;
if no_list_temp.Count>0 then
begin
showmessage('剔除号码数量为'+inttostr(no_list_temp.Count)+',请保存!');
if SaveDialog1.Execute then
begin
if trim(Memo3.Text)<>'' then no_list_temp.Insert(0,Memo3.Text);
no_list_temp.SaveToFile(SaveDialog1.FileName);
end;
end;
no_list_temp.Clear;
for i:=0 to no_y.Count-1 do
begin
if trim(no_y.Strings[i])<>'' then no_list_temp.Add(trim(no_y.Strings[i]))
end;
no_y.Clear;
no_y.DelimitedText:=no_list_temp.DelimitedText;
no_list_temp.Clear;
no_list_temp.Destroy;
end;
StatusBar1.Panels.Items[0].Text:='号码数量:'+inttostr(no_y.Count);
end;
procedure TForm1.N11111Click(Sender: TObject);
var i,i_hd_c:integer;
no:string;
no_list_temp:TStringList;
begin
i:=0;
i_hd_c:=0;
no_list_temp:=TStringList.Create;
no_list_temp.Clear;
no_hd.Clear;
memo1.Clear;
//memo4.Clear;
no_y.Sort;
while i<no_y.Count do
begin
no:= leftstr(no_y.Strings[i],7);
if is_int(no) then
begin
if no_hd.Count>0 then
begin
if (no_hd.Strings[no_hd.Count-1]=no) then
begin
inc(i_hd_c);
end
else
begin
no_hd.Add(no);
if i_hd_c<2 then no_list_temp.Add(inttostr(i_hd_c));
i_hd_c:=1;
memo1.Lines.Add(no_y.Strings[i]);
end ;
end
else
begin //增加第一个号码
no_hd.Add(no);
memo1.Lines.Add(no_y.Strings[i]);
i_hd_c:=1;
end;
end ;
Application.ProcessMessages;
StatusBar1.Panels.Items[1].Text:='提取号段:'+inttostr(no_hd.Count);
//StatusBar1.Panels.Items[2].Text:='单一号码:'+inttostr(no_list_temp.Count);
inc(i) ;
end;
//howmessage(no_list_temp.DelimitedText);
//提取数量少于3的号段
i:=0;
while i<no_list_temp.Count do
begin
memo4.Lines.Add(memo1.Lines.Strings[i]);
inc(i);
StatusBar1.Panels.Items[1].Text:='提取测试号码:'+inttostr(i);
Application.ProcessMessages;
end;
//提取数量少于3的号段
//StatusBar1.Panels.Items[1].Text:='提取测试号码:'+inttostr(no_hd.Count);
no_list_temp.Clear;
no_list_temp.Destroy;
end;
procedure TForm1.Button4Click(Sender: TObject);
var i:integer;
limit_temp:string;
str_temp1,str_temp2:string;
no_list_temp:TStringList;
begin
i:=0;
limit_temp:='5';
if (memo4.Lines.Count<2) then limit_temp:='测试号码数量少于2,不需要进一步筛选';
if InputQuery('请输入数字,即前X位相同', '前X位相同的将剔除 ',limit_temp) then
begin
if is_int(limit_temp)and (memo4.Lines.Count>2) then
begin
if (strtoint(limit_temp)>2) and (strtoint(limit_temp)<7) then
no_list_temp:=TStringList.Create;
no_list_temp.Clear;
no_list_temp.Sorted:=true;
no_list_temp.DelimitedText:=memo4.Lines.DelimitedText;
memo4.Clear;
while i<no_list_temp.Count-1 do
begin
str_temp1:=leftstr(trim(no_list_temp.Strings[i]),strtoint(limit_temp));
str_temp2:=leftstr(trim(no_list_temp.Strings[i+1]),strtoint(limit_temp));
if str_temp1<>str_temp2 then
begin
memo4.Lines.Add(no_list_temp.Strings[i]);
end;
if i=no_list_temp.Count-2 then memo4.Lines.Add(no_list_temp.Strings[i+1]);
inc(i);
StatusBar1.Panels.Items[1].Text:='进一步筛选中:'+inttostr(i);
Application.ProcessMessages;
end ;
no_list_temp.Clear;
no_list_temp.Destroy;
end
end;
end;
procedure TForm1.Memo3Change(Sender: TObject);
begin
memo3.Hint:='信息长度:'+inttostr(length(widestring(memo3.Text)));
end;
procedure TForm1.Memo3Click(Sender: TObject);
begin
memo3.Hint:='信息长度:'+inttostr(length(widestring(trim(memo3.Text))));
end;
procedure TForm1.Memo5Change(Sender: TObject);
var i:integer;
begin
all_bd.DelimitedText:=memo5.Text;
memo5.Hint:='长度:'+inttostr(length(widestring(trim(memo5.Text))));
all_bd.Sort;
save_inifile('sys.ini','Option','str1',all_bd.DelimitedText);
//StrPCopy(all_bd_array,'');
for i:=0 to all_bd.Count-1 do
all_bd_array[i]:=all_bd.Strings[i];
end;
procedure TForm1.Button3Click(Sender: TObject);
var i:integer;
strtemp,SMSSTR:widestring;
begin
if length(memo3.Text)>10 then
begin
strtemp:=trim(widestring(memo3.Text));
for i:=0 to length(widestring(memo3.Text)) do
begin
if all_bd.IndexOf(strtemp[i])>0 then
SMSSTR:=SMSSTR+'㏄'
ELSE
SMSSTR:=SMSSTR+strtemp[i];
end;
MEMO6.Text:=TRIM(SMSSTR)
end;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
MEMO6.Clear;
//showmessage(SMSReplace(MEMO6.Text));
//MEMO6.Text :=Randomstring(all_bd_array,all_bd.Count);
end;
procedure TForm1.Memo6Click(Sender: TObject);
begin
memo6.Hint:='信息长度:'+inttostr(length(widestring(trim(memo6.Text))));
end;
procedure TForm1.Button6Click(Sender: TObject);
var i,i1,i2:integer;
limit_temp,smstemp:string;
no_list_temp:TStringList;
begin
if trim(Memo6.Text)='' then EXIT;
limit_temp:=EDIT2.Text;
if InputQuery('请输入导出数量', '导出的是最后X个号码 ',limit_temp) then
begin
if is_int(limit_temp)then
begin
no_list_temp:=TStringList.Create;
i1:= no_y.Count-strtoint(limit_temp);
if i1>0 then i2:=strtoint(limit_temp) else i2:=no_y.Count;
for i:=0 to i2-1 do
begin
smstemp:=SMSReplace(MEMO6.Text);
Application.ProcessMessages;
no_list_temp.Add(no_y.Strings[no_y.Count-1]+','+smstemp);
no_y.Delete(no_y.Count-1);
StatusBar1.Panels.Items[1].Text:='号码数量:'+inttostr(no_y.Count);
end;
if no_list_temp.Count>0 then
begin
if SaveDialog1.Execute then
begin
//no_list_temp.Insert(0,Memo3.Text);
no_list_temp.SaveToFile(SaveDialog1.FileName);
StatusBar1.Panels.Items[2].Text:='导出:'+inttostr(no_list_temp.Count-1);
end
else
begin
for i:=0 to no_list_temp.Count-1 do
begin
no_y.Add(LEFTSTR(no_list_temp.Strings[0],11));
no_list_temp.Delete(0);
StatusBar1.Panels.Items[1].Text:='号码数量:'+inttostr(no_y.Count);
Application.ProcessMessages;
end;
end;
end;
no_list_temp.Clear;
no_list_temp.Destroy;
end
end;
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
save_inifile('sys.ini','Option','str2',Edit1.Text);
end;
procedure TForm1.Memo7Change(Sender: TObject);
begin
memo7.Hint:='数量:'+inttostr(memo7.Lines.Count);
save_inifile('sys.ini','Option','str3',memo7.Lines.DelimitedText);
end;
procedure TForm1.Memo7Click(Sender: TObject);
begin
memo7.Hint:='数量:'+inttostr(memo7.Lines.Count);
end;
procedure TForm1.Edit3Change(Sender: TObject);
begin
save_inifile('sys.ini','Option','str4',Edit3.Text);
end;
procedure TForm1.Button7Click(Sender: TObject);
var i,i1,i2:integer;
begin
i2:=0;
for i:=0 to no_y.Count-1 do
begin
if i mod strtoint(edit3.Text)=100 then
begin
for i1:=0 to memo7.Lines.Count-1 do
begin
no_y.Insert(i,memo7.Lines.Strings[i1]);
inc(i2);
end;
end;
end;
showmessage('共插入测试号码 '+inttostr(i2)+' 个');
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -