Tuesday, 17 July 2012

.Net Tips , C# Tip : Get System Folder Path using C# Examples and VB.Net Examples

You can get System Folder path using code using "System.Environment" Class.
We are using  Static / Shared "GetFolderPath" method of Environment Class.

Here is examples of this.
In this example we get system folder path and display on screen.

C# Examples :
 string strSystemPath = Environment.GetFolderPath(Environment.SpecialFolder.System);
 Response.Write("<b>System Folder Path :</b> " + strSystemPath);

VB.net Example :
 Dim strSystemPath As String = Environment.GetFolderPath(Environment.SpecialFolder.System)
 Response.Write("System Folder Path:" + strSystemPath)

Output :
This type of C# Tips is very useful in day to day programming life.

Note : Give Us your valuable feedback in comments. Give your suggestions in this article so we can update our articles accordingly that.


No comments:

Post a Comment