比如,现在我拨号了,开始等待接收事件,有时返回BUSY,有时返回CONNECT,等待时间的如何确定? 那位有源码,参考参考
解决方案 »
- 请教一个Socket相关的简单问题
- 为什程序关了,还提示有程序在使用该文件
- ★★★★再放200 嘿嘿~~★★★★
- 求购类似QQ表情的代码,高手说说价格。。我的QQ:32690107
- 请教:在delphi中如何调用写字板程序?高手指教
- 大侠帮忙啊,如何在Delphi程序里加载、显示网页?
- 100分求一菜鸟例程;单线程在Memo中增加100行内容。顶者有分。最迟本周日结贴。
- 要在窗体show出以后,马上create并show出子窗体,怎么做?
- 我已经没分!!!请大家原谅!!我在同一个根目录下建立了两个子目录,如:(1)..\data\aa.db;(2)..\sys\bb.db;
- 如何求edit.text中字符串长度?
- 菜鸟的真诚提问关于 TSHFILEINFO 授吾与渔!!!!!!!!!!!!!!!!!
- sql语句问题 怎样让查询结果显示保留小数一位
procedure TForm1.MSComm1Comm(Sender: TObject);
var
i,InputLen:Integer;
tmpInt:Integer;
tmpvar:Variant;
InputString:String;
begin
if MSComm1.CommEvent=ComEvReceive then
begin
InputLen:=MSComm1.InBufferCount;
//接收二进制数据,转换为十六进制显示
if HexShow.Checked then
begin
MSComm1.InputMode:=1;
tmpvar:=MSComm1.Input;
InputString:='';
for i:= 0 to InputLen-1 do
begin
tmpInt:=tmpvar[i];
InputString:=InputString+' '+IntToHex(tmpint,2);
end;
end
//直接接收字符
else begin
MSComm1.InputMode:=0;
InputString:=MSComm1.Input;
end;
memo1.text:=Memo1.Text+Inputstring;
if InputString='ERROR' then
begin
ShowMessage('');
end;
showmessage(inputstring);
end;
end;procedure TForm1.BitBtn1Click(Sender: TObject);
var
str:string;
begin
str:=edit1.Text;
with mscomm1 do
begin
if not portopen then
begin
portopen:=true;
end;
settings:='1200,n,8,1';
output:=str+chr(10)+chr(13);
end;
end;
re = 0 //成功
entname,err:pchar;
re:Dword;
wx:string;
begin
GetMem(err,256);
entname := 'd';
//new(rasparm);
//new(rash);Label1.Caption := '正在拔号……';
ZeroMemory(@rasparm,sizeof(trasDIALPARAMS) );
rasparm.dwSize := sizeof(trasDialParams);if trim(wx) = '' then
wx := '16900'
else
wx := wx + ',16900';CopyMemory(@rasparm.szPhoneNumber[0],pchar(wx),length(wx));
rasparm.szCallbackNumber := '*';
rasparm.szPassword := '16900';
rasparm.szUserName := '16900';rasparm.szDomain := '*';//entname := getentname();
entname := pchar(GetEntName);
CopyMemory(@rasparm.szEntryName[0],entname,length(entname));
re := RasDialA(nil,nil,@rasparm,0,nil,@rash);
if re = 0 then begin
Dispose(err);
pr_starttime := Now();
end else begin
RasGetErrorStringA(re,err,256);
//MessageBox(0,err,'拔号失败',MB_OK);
dm.wf_showpop('拔号失败');
Dispose(err);
result := false;
end;end;