I want to display 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:
txtServerName.Text = System.Net.Dns.GetHostName(Application.StartupPath)
Second try:
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."