|
-
Jun 2nd, 2020, 09:31 AM
#1
Thread Starter
Member
How to get the computer name from other computer where my program installed?
I have a shared program from other PC. I want to display into textbox the computer name from other PC where my shared program installed.
Using "application.startup" the vb can detect where the program came from. Yes it displays the path (e.g. \\PC1\sampleprogram\) but I want to get or to display "PC1" into textbox. Any suggestion or modification regarding my code?
What I have tried:
First try but not working:
Hide Copy Code
txtServerName.Text = System.Net.Dns.GetHostName(Application.StartupPath)
Second try:
Hide Copy Code
txtServerName.Text = System.Environment.GetEnvironmentVariable("ComputerName"(Application.StartupPath))
All are not working. It shows error "Additional information: Conversion from string "C:\Users\r0n\Documents\Visual St" to type 'Integer' is not valid."
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|