我用ADSLMODEM接入网卡上网.
解决方案 »
- 我想改变headercontrol的sections里面文字的颜色,怎么办?
- 关于Findwindow
- 多线程的问题,你应该会的,
- 怎样删除服务器上的文件目录?
- 请问各位大侠,可否实现类似IE收藏夹那样根据一个文件夹内的文件和子文件夹来动态的添加菜单项》?
- 把数据连接模块打包成dll如何连接,请各位帮忙.
- .小弟用canvas的textout方法+TTimer控件实现字幕功能,为何不能像foxmail的邮件提示栏那样做到文字没有闪烁?
- 做一个这样财务软件, 大约要多少钱?
- 问两个问题!
- 请问:如何使Form.show的窗口获得焦点?
- 这样的sql语句怎样写???
- 我是做ERP的,我现在觉得我对业务一点不懂,特别是对财务这方面,不知怎么可以提高
2000中用ipconfig (好像是,记不太清)
delphi中编程如何实现!
type
TaPInAddr = array [0..10] of PInAddr;
PaPInAddr = ^TaPInAddr;
var
phe : PHostEnt;
pptr : PaPInAddr;
Buffer : array [0..63] of char;
I : Integer;
GInitData : TWSADATA;
begin
WSAStartup($101, GInitData);
Result := '';
GetHostName(Buffer, SizeOf(Buffer));
phe :=GetHostByName(buffer);
if phe = nil then Exit;
pptr := PaPInAddr(Phe^.h_addr_list);
I := 0;
while pptr^[I] <> nil do begin
result:=StrPas(inet_ntoa(pptr^[I]^));
Inc(I);
end;
WSACleanup;
end;
http://expert.csdn.net/Expert/TopicView1.asp?id=1937215
转的。
另外这些函数还包括网卡的一些设置。
增加一个IP地址。
很多呀
下面这个函数是得到一个数组的。
GetIpAddrTableThe GetIpAddrTable function retrieves the interface–to–IP address mapping table.
DWORD GetIpAddrTable(
PMIB_IPADDRTABLE pIpAddrTable,
PULONG pdwSize,
BOOL bOrder
);Parameters
pIpAddrTable
[out] Pointer to a buffer that receives the interface–to–IP address mapping table as a MIB_IPADDRTABLE structure.
pdwSize
[in, out] On input, specifies the size of the buffer pointed to by the pIpAddrTable parameter.
On output, if the buffer is not large enough to hold the returned mapping table, the function sets this parameter equal to the required buffer size.bOrder
[in] Specifies whether the returned mapping table should be sorted in ascending order by IP address. If this parameter is TRUE, the table is sorted.
Return Values
If the function succeeds, the return value is NO_ERROR.If the function fails, the return value is one of the following error codes.Return Code Description
ERROR_INSUFFICIENT_BUFFER The buffer pointed to by the pIpAddrTable parameter is not large enough. The required size is returned in the DWORD variable pointed to by the pdwSize parameter.
ERROR_INVALID_PARAMETER The pdwSize parameter is NULL, or GetIpAddrTable is unable to write to the memory pointed to by the pdwSize parameter.
ERROR_NOT_SUPPORTED This function is not supported on the operating system in use on the local system.
Other Use FormatMessage to obtain the message string for the returned error.
procedure TIdStackWindows.PopulateLocalAddresses;
type
TaPInAddr = Array[0..250] of PInAddr;
PaPInAddr = ^TaPInAddr;
var
i: integer;
AHost: PHostEnt;
PAdrPtr: PaPInAddr;
begin
FLocalAddresses.Clear ;
AHost := GetHostByName(PChar(WSGetHostName));
if AHost = nil then
begin
CheckForSocketError(SOCKET_ERROR);
end
else
begin
PAdrPtr := PAPInAddr(AHost^.h_address_list);
i := 0;
while PAdrPtr^[i] <> nil do
begin
FLocalAddresses.Add(TInAddrToString(PAdrPtr^[I]^));
Inc(I);
end;
end;
end;
这是那个函数的原代码。是不是很简单,你可以直接调用就可以了。