各位!怎么把一个点分十进制的IP地址转成长整形?
解决方案 »
- 如何查询号同一表中不同字段的相同内容?
- ***小弟这段代码为什么会内存一直增加啊?急啊!!!!!!*****
- 请教提交TWebBrowser按钮的问题,框架结构
- 访问ACCESS数据由于自动编号字段引起的问题
- 我想学习“构造”“析构”“重载”“指针”“虚方法”...,那里有资料,或好的建议?
- 三层数据库应用系统的数据并行控制
- delphi TrzpageControl 标题栏的问题
- 这两天我在做一个文件加密的程序,但是再读取文件的时候不知道为什么会那么慢?
- 关于delphi动态加载控件,在线
- 文件名称的问题
- stringGrid的OnDrawCell的效率(高手请进)
- fastreport显示一组数据的问题
var
vIndex: Integer;
vIP: String;
begin
Result := 0;
vIP := IP;
vIndex := Pos('.', vIP);
Result := Result + StrToInt(Copy(vIP, 1, vIndex - 1)) * $1000000;
Delete(vIP, 1, vIndex);
vIndex := Pos('.', vIP);
Result := Result + StrToInt(Copy(vIP, 1, vIndex - 1)) * $10000;
Delete(vIP, 1, vIndex);
vIndex := Pos('.', vIP);
Result := Result + StrToInt(Copy(vIP, 1, vIndex - 1)) * $100;
Delete(vIP, 1, vIndex);
Result := Result + StrToInt(vIP);
end;function LongIntToIP(LnInt: LongWord): String;
var
vLnInt: LongWord;
begin
Result := IntToStr(LnInt div ($1000000)) + '.';
vLnInt := LnInt mod $1000000;
Result := Result + IntToStr(vLnInt div $10000) + '.';
vLnInt := vLnInt mod $10000;
Result := Result + IntToStr(vLnInt div $100) + '.' + IntToStr(vLnInt mod $100);
end;