Hi All,
I am trying to migrate from Vlisp to C# .Net & occationally struggle with simple things. Some of my Vlisp applications have an "about" command which shows a product info dialog similar to the default AutoCAD product info dialog. However, in C#, I am struggling with the code to obtain the Computer Name as a string. Would someone please mind showing an example of the required syntax to retrieve the ComputerName property from WhoHasInfo (or anywhere else for that matter) so as it can be shown in a form. See attachment which shows the existing Vlisp dialog.
Any help much appreciated as always.
AutoCAD 2009/2010 on XP Pro SP3.
Steve
Solved! Go to Solution.
Solved by jeff. Go to Solution.
Have you looked at the System.Environment.MachineName Property
http://msdn.microsoft.com/en-us/library/z8te35sa.aspx
The System.Environment class has other information pertaing to local enviroment.
ed.WriteMessage(Environment.MachineName); ed.WriteMessage(Environment.UserName); ed.WriteMessage(Environment.CurrentDirectory);
Thanks for your prompt reply Jeff.
Presumably, (environment.machinename) returns a string which may then be assigned to a variable thus:
string compName = (environment.machinename)
Forgive me spelling things out like this but I do not have VS installed on the PC I am using at the moment.
Steve