Sidebar

Get System Name

0 votes
494 views
asked Jan 14, 2015 by js-6370 (360 points)
Is there a way for me to get the System Name so I can send it in an email message?

2 Answers

0 votes
 
Best answer

UPDATE: as of version 2.0.41, the Code Wizard will have two new functions:

  1. getSystemName()
  2. getServerNameWithPort()

These are added as the enhancements for feature #1271.

answered Feb 18, 2015 by david-f-5427 (1,660 points)
selected Mar 3, 2015 by gary-t-8719
+1 vote

In a windows environment, you can get the computer name from the environment variable with this:

java.lang.System.getenv("COMPUTERNAME");

You can also rely on the DNS to identify the host name of the QIE server with this:

java.net.InetAddress.getLocalHost().getHostName();

There is not currently an API to return the System Configuration -> System Name value.  We have entered an enhancement request for this feature.  (Bug# 1271)

answered Jan 14, 2015 by mike-r-7535 (13,830 points)
commented Jan 14, 2015 by js-6370 (360 points)
I used the java.net.InetAddress.getLocalHost().getHostName(); and that works quite well. Thank you for your help.
commented Jan 14, 2015 by mike-r-7535 (13,830 points)
You are welcome.  Glad it worked for you.
...