Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

How to, using ASP.NET

0.00/5 (No votes)
29 Nov 2011 3  
Some useful tricks in ASP.NET.

Question: How can I find out my computer's machine name with ASP.NET?


Answer:


ASP.NET
<%
Response.Write("The MachineName is " &
S􀁜stem.Environment.MachineName.ToString() )
%>

Question: How can I find out m􀁜 memor􀁜 working set with ASP.NET?


Answer:


ASP.NET
<%
Response.Write("The Working Set is " &
S􀁜stem.Environment.WorkingSet.ToString() & " b􀁜tes")
%>

Question: How can I find out m􀁜 S􀁜stem Director􀁜 with ASP.NET?


Answer:


ASP.NET
<%
Response.Write("The S􀁜stem Director􀁜 is " &
S􀁜stem.Environment.S􀁜stemDirector􀁜.ToString() )
%>

Question: How can I find out the OS Version m􀁜 computer is running with ASP.NET?


Answer:


ASP.NET
<%
Response.Write("The OS Version is " &
S􀁜stem.Environment.OSVersion.ToString() )
%>

Question: How can I find out the USERPROFILE environment variable with ASP.NET?


Answer:


ASP.NET
<%
Response.Write("The USERPROFILE environment variable is : " &
Environment.GetEnvironmentVariable("USERPROFILE"))
%>

Question: How can I find out what version of ASP.NET is running on my computer?


Answer:


ASP.NET
<%
Response.Write("The .NET version is " &
S􀁜stem.Environment.Version.ToString() )
%>

Question: How can I find out what version of ASP.NET is running on my computer?


Answer:


ASP.NET
<%
Response.Write("The .NET version is " &
S􀁜stem.Environment.Version.ToString() )
%>

Question: How can I find out where the temp director􀁜 is located?


Answer:


ASP.NET
<%
Response.Write("The TEMP environment variable is : " &
Environment.GetEnvironmentVariable("TEMP"))
%>

Question: How can I find out which account ASP.NET is running as?


Answer:


ASP.NET
<%
Response.Write("ASP.NET is running as the account : " &
Environment.Username)
%>

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here