取消
显示结果 
搜索替代 
您的意思是: 

Get Computer Name

I think there was a VI
'Get computer name'
somewhere in the GToolbox (or former LVutil).
I cannot find it - any hints?

I need the name of the computer the program works on because it
communicates with another application via TCP/IP and I would like to set
the standard application adress as the local PC.

Thanks
Urs Bögli
0 项奖励
1 条消息(共 12 条)
24,280 次查看
Hello Urs,

An easy way is to use the "string to IP" wired to the "IP to string" VI (TCP palette). The IP to string function has a boolean input where you can define if you want to see the IP address or the machine name of the PC.

Regards,
Luca
Regards,
Luca
2 条消息(共 12 条)
24,280 次查看
hello

See the attached vi
Hope it helps.
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
3 条消息(共 12 条)
24,282 次查看
Luca,
that's fine, an easy solution but hard to find !

Attached is my VI now.

Thanks
Urs

Luca P. schrieb:

>Hello Urs,
>
>An easy way is to use the "string to IP" wired to the "IP to string"
>VI (TCP palette). The IP to string function has a boolean input where
>you can define if you want to see the IP address or the machine name
>of the PC.
>
>Regards,
>Luca
>
4 条消息(共 12 条)
24,282 次查看
Alipio,
thanks for this solution. I think its disadvantge is the OS dependance.
Some target PCs are Win98, some Win2000.
The other solution mentioned seems to be independent of the platform and
is very easy to implement!
see other news
Urs

alipio schrieb:

>hello
>
>See the attached vi
>Hope it helps.
>Alipio
>
0 项奖励
5 条消息(共 12 条)
24,282 次查看

This one worked nice!

 

0 项奖励
6 条消息(共 12 条)
19,140 次查看

You could always use the system exec to run the command

 

IPCONFIG /ALL

 

Then parse the text for the Host Name

 

That would eliminate any Windows version poblems.

========================
=== Engineer Ambiguously ===
========================
7 条消息(共 12 条)
19,120 次查看

More than ten years later, Luca's solution is still very easy and has no Windows version problems. It looks like this :

 

Computer name.png

8 条消息(共 12 条)
19,100 次查看

If you want more than just the computer name, you can use something like this.

"If you weren't supposed to push it, it wouldn't be a button."
9 条消息(共 12 条)
19,064 次查看

But not such a good solution on Windows Server OS:

 

https://lavag.org/topic/19322-get-host-name-performance-issue/

 

-John
------------------------
Certified LabVIEW Architect
0 项奖励
10 条消息(共 12 条)
17,613 次查看