Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7505155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:48:43+00:00 2026-05-29T21:48:43+00:00

I want to call the netsh command from .net, I am using the Process

  • 0

I want to call the netsh command from .net, I am using the Process class to initiate the process which calls the netsh command, and its working fine, now I want to get the output returned by the netsh command in .NET, for example I am calling the below command in Process:

netsh wlan show hostednetwork

this is returning me the list of active hostednetwork.

How can I read the list in .NET?
Can anyone assist me or take me to the right path (I don’t want to use any third party tools)?


UPDATES
Below is my return output using netsh wlan show hostednetwork command

Hosted network settings

Mode                   : Allowed
SSID name              : "AqaMaula(TUS)"
Max number of clients  : 100
Authentication         : WPA2-Personal
Cipher                 : CCMP

Hosted network status

Status                 : Started
BSSID                  : 06:65:9d:26:f4:b7
Radio type             : 802.11n
Channel                : 11
Number of clients      : 1
    d0:c1:b1:44:8b:f0        Authenticated

Can anyone tell me how can i get all individual data and put them in database like, Mode, SSID Name, etc. (individually)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:48:45+00:00Added an answer on May 29, 2026 at 9:48 pm

    Here is the code:

    using System;
    using System.Diagnostics;
    
    public static class Program
    {
        public static void Main()
        {
            var output = RunProcess();
            Console.WriteLine(output);
        }
    
        /// <summary>
        /// Runs the process: starts it and waits upon its completion.
        /// </summary>
        /// <returns>
        /// Standart output content as a string.
        /// </returns>
        private static string RunProcess()
        {
            using (var process = CreateProcess())
            {
                process.Start();
    
                // To avoid deadlocks, always read the output stream first and then wait.
                // For details, see: [Process.StandardOutput Property (System.Diagnostics)](https://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardoutput(v=vs.110).aspx).
                var output = process.StandardOutput.ReadToEnd();
                process.WaitForExit();
    
                return output;
            }
        }
    
        private static Process CreateProcess()
        {
            return new Process
                {
                    StartInfo =
                        {
                            FileName = "netsh",
                            Arguments = "wlan show hostednetwork",
                            UseShellExecute = false,
                            RedirectStandardOutput = true
                        }
                };
        }
    }
    

    Update

    I think you should use Managed Wifi API framework instead of parsing results of command line utility. It is more reliable way. Take a look at the sources, they contain WifiExample.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to call my .NET code from unmanaged C++. My process entrypoint is
I want to call a function from a .NET DLL (coded in C#) from
I want to call Program1 from Program2 with exact same parameters which I called
I m developing website. i want call one ashx file which return all process
I want call a function which makes my main thread stuck using the above
I want to call the base class implementation of a virtual function using a
I want to calling a javascript function from a asp.net modal window using vb.
I want to call browser window resize method using jquery from with in iframe.
I want to call a few static methods of a CPP class defined in
I want to call a c# function from my javascript function. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.