| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 529 人关注过本帖
标题:[求助]急!关于DELPHI8的使用WINSOCK
只看楼主 加入收藏
tantan214
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-4-26
收藏
 问题点数:0 回复次数:1 
[求助]急!关于DELPHI8的使用WINSOCK

unit sy102Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Borland.Vcl.StdCtrls, System.ComponentModel,WinSock;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
function GetHostName:String;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.nfm}
function TForm1.GetHostName:String;
var
ComputerName: array[0..MAX_COMPUTERNAME_LENGTH+1] of char;
Size: Cardinal;
begin
result:='';
Size := MAX_COMPUTERNAME_LENGTH+1;
GetComputerName(ComputerName, Size);
Result:=StrPas(ComputerName);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Text:=GetHostName;
Edit2.Text:=DateTimeToStr(Now);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Text:='';
Edit2.Text:='';
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
application.Terminate;
end;

end.
这是使用DELPHI8获取计算机名称的程序,但不知为什么,在USER中不能直接通过添加WINSOCK来实现GETCOMPUTERNAME()函数的调用,在DELPHI7可以?请指教,谢谢!

搜索更多相关主题的帖子: WINSOCK 
2006-04-26 18:44
tantan214
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-4-26
收藏
得分:0 

怎么没人回复的????
那位高手请帮帮忙,谢谢!

2006-04-26 22:18
快速回复:[求助]急!关于DELPHI8的使用WINSOCK
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024613 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved