Jitesh Byahut 2/16/2104 2684

Win32_Share in WMI C# Asp.Net

Here we are retrieving Share details of Computer.

Use namespace System.Management

using System.Management;

 

public partial class Win_Win32_Share : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        ManagementObjectSearcher objshare = new ManagementObjectSearcher("select * from win32_Share");

 

        foreach (ManagementObject obj in objshare.Get())

        {

            Response.Write("Name  -  " + obj["Name"] + "</br>");

            Response.Write("Description  -  " + obj["Description"] + "</br>");

            Response.Write("Path  -  " + obj["Path"] + "</br>");

            Response.Write("Type  -  " + obj["Type"] + "</br></br>");

        }

    }

}

Demo

View Output:

demoimage


Please give your feedback for improving this page