新手delphi有关问题 大家来看一上
新手delphi问题 大家来看一下
------解决方案--------------------
你那个button1onclick过程是你自己手动加上去的吗?
------解决方案--------------------
在你的button1看按扭下双击下就KOK
------解决方案--------------------
你先把旧的button1onclick删除,然后按#2那样做,然后在新的button1onclick里填代码
//可以编译运行 是获取本机IP地址的程序 但是 运行之后没反应 新手不知道怎么调试 才能调出来 一直不行 求教!!! unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,Winapi.WinSock,Winapi.Winsock2;
type TForm1 = class(TForm)
mmo1: TMemo;
Button1: TButton;
procedure button1onclick(sender:tobject);
private { Private declarations }
public{ Public declarations }
end;
var Form1: TForm1;
implementation
{$R *.dfm}
function getip:AnsiString;
typetinaddr=array[0..10]of PInAddr;
vv= ^TInAddr;
var tw:TWsaData;
buffer:array[0..63]of ansiChar;
hen:phostent;
gg:vv;
i:Integer;
begin
WSAStartup($2,tw);
gethostname(buffer,SizeOf(buffer));
hen:=gethostbyname(buffer);
if hen=nil then raise exception.Create('没找到');
gg:=vv(hen^.h_addr_list);
i:=0;
while gg^[i]<>nil do
begin
result:=StrPas(inet_ntoa(gg^[i]^));
inc(i);
end;
WSACleanup();
end;
procedure tform1.button1onclick(sender:tobject);
var zz:AnsiString;
begin mmo1.clear;
mmo1.readonly;
mmo1.Lines.Add('zz') ;
end;
end.
------解决方案--------------------
你那个button1onclick过程是你自己手动加上去的吗?
------解决方案--------------------
在你的button1看按扭下双击下就KOK
------解决方案--------------------
你先把旧的button1onclick删除,然后按#2那样做,然后在新的button1onclick里填代码