I use VB.NET for a Windows application.
How can I find out if the开发者_Go百科 application is now running on a server or client (programmatically)?
Thanks.
This is a little ambiguous since any machine can be a server or a client. One way you could check is by inspecting the Environment.MachineName
variable:
If Environment.MachineName = "MyServerName" Then
''Do something here.
End If
MSDN : http://msdn.microsoft.com/en-us/library/system.environment.machinename.aspx
精彩评论