Domino问题

zou5655 2001-12-06 11:07:02
怎样获得Domino所在的服务器IP地址,谢谢大师
...全文
167 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
lilly317 2001-12-24
  • 打赏
  • 举报
回复
不能从hosts文件中取吗?
java31 2001-12-23
  • 打赏
  • 举报
回复
http_host
quake3 2001-12-14
  • 打赏
  • 举报
回复
用API函数
michael_law 2001-12-14
  • 打赏
  • 举报
回复
RE: How to get a local Ip address using lotusscript?
Posted by Wes Richardson on 21.Sep.01 at 03:16 using a Web browser
Category: Domino Designer -- Editor ElementsRelease: 5.0.5Platform: All Platforms
Hi Ruby

I searched this forum and got this information.

In the Declarations insert the following code:
Type HOSTENT
hName As Long
hAliases As Long
hAddrType As Integer
hLen As Integer
hAddrList As Long
End Type

Declare Function gethostname Lib "WSOCK32.DLL" (Byval szHost As String, Byval dwHostLen As Long) As Long
Declare Function gethostbyname Lib "WSOCK32.DLL" (Byval szHost As String) As Long
Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, Byval hpvSource As Long, Byval cbCopy As Long)

The rest of the code can be put where you need it :

Dim HostName As String * 256
Dim HostPointer As Long
Dim HostStruct As HOSTENT
Dim HostAddressPointer As Long
Dim HostAddress As Long
Dim AddressNum As String
Dim Address As String

gethostname HostName, 256
HostName = Trim(HostName)
HostPointer = gethostbyname(HostName)

CopyMemory HostStruct, HostPointer, Len(HostStruct)
CopyMemory HostAddressPointer, HostStruct.hAddrList, 4
CopyMemory HostAddress, HostAddressPointer, 4

AddressNum = Trim(Hex(HostAddress))
AddressNum = String(8-Len(AddressNum), Asc("0")) & AddressNum

Address = Cstr(Cint("&H" & Mid(AddressNum, 7))) & "." & Cstr(Cint("&H" & Mid(AddressNum, 5, 2))) & "." & Cstr(Cint("&H" & Mid(AddressNum, 3, 2))) & "." & Cstr(Cint("&H" & Left(AddressNum, 2)))



michael_law 2001-12-14
  • 打赏
  • 举报
回复
只能通过API来取ip地址,notes不提供函数。
RickeyLv 2001-12-06
  • 打赏
  • 举报
回复
可以用api函数呀,就跟在vb中一样呀。
yw_w 2001-12-06
  • 打赏
  • 举报
回复
可以去ini或随便什么文件中去取
hhxz770 2001-12-06
  • 打赏
  • 举报
回复
@_@ 1.做个ini文件,去取
2。做个socket程序,自动得到
azend 2001-12-06
  • 打赏
  • 举报
回复
用于什么目的?看看这样行不行
条件:
已连接服务器;
方法:
在服务器文档中填写IP地址(或自行设计的数据库中),
用的时候从文档中取出,与一般的数据没什么区别。
liu801215 2001-12-06
  • 打赏
  • 举报
回复
C/S结构
5iCoding 2001-12-06
  • 打赏
  • 举报
回复
b/s还是c/s?

535

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧