Click here to Skip to main content
15,920,005 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionRe: tag cloud [modified] Pin
shah zad20-Jan-08 20:30
shah zad20-Jan-08 20:30 
GeneralRe: tag cloud Pin
Colin Angus Mackay20-Jan-08 23:03
Colin Angus Mackay20-Jan-08 23:03 
GeneralEditing the gridview directly Pin
SreejithAchutan20-Jan-08 17:55
SreejithAchutan20-Jan-08 17:55 
GeneralRe: Editing the gridview directly Pin
Venkatesh Mookkan20-Jan-08 18:05
Venkatesh Mookkan20-Jan-08 18:05 
GeneralRe: Editing the gridview directly Pin
SreejithAchutan20-Jan-08 18:44
SreejithAchutan20-Jan-08 18:44 
GeneralRe: Editing the gridview directly Pin
Venkatesh Mookkan21-Jan-08 0:23
Venkatesh Mookkan21-Jan-08 0:23 
Generalcheck LAN status Pin
saravanan0520-Jan-08 16:51
saravanan0520-Jan-08 16:51 
GeneralRe: check LAN status Pin
Venkatesh Mookkan20-Jan-08 17:49
Venkatesh Mookkan20-Jan-08 17:49 
saravanan05 wrote:
I want to check whether a system is connected with a LAN or not? How can i do it using .Net either VB or C#.



I am not sure about checking the LAN connection.



saravanan05 wrote:
Second thing is after detecting the network connection i want to find the IP address OR Machine name of the Local Area Network Server. And using that LAN server IP/Name i want to listout all the machines that are connected at this moment. How can i do this?


Try the below code. You get the computer's list in a DataTable.

public DataTable GetComputers
    {
        DataTable dtComputers = new DataTable("Computers");
        DataColumn dc;
        DataRow dr;

        dc = new DataColumn("ComputerName");
        dc.DataType = System.Type.GetType("System.String");
        dc.MaxLength = 50;
        dtComputers.Columns.Add(dc);

        dc = new DataColumn("IPAddress");
        dc.DataType = System.Type.GetType("System.String");
        dc.MaxLength = 50;
        dtComputers.Columns.Add(dc);

        Process p = new Process();
        p.StartInfo.FileName = @"net.exe";
        p.StartInfo.Arguments = "VIEW";
        p.StartInfo.CreateNoWindow = true;
        p.StartInfo.RedirectStandardOutput = true;
        p.StartInfo.UseShellExecute = false;

        p.Start();
        p.WaitForExit();


        while (!p.StandardOutput.EndOfStream)
        {
            string readLine = p.StandardOutput.ReadLine();
            string computerName = "";

            if (readLine.IndexOf("\\") == 0)
            {
                dr = dtComputers.NewRow();

                computerName = readLine.Substring(2, readLine.IndexOf(" ")).Trim();

                Console.Write("\n" + computerName);

                dr["ComputerName"] = computerName;
                dr["IPAddress"] = Dns.GetHostEntry(computerName).AddressList[0];

                dtComputers.Rows.Add(dr);
            }

        }
        if (!p.HasExited) p.Kill();
        return dtComputers;
    }



[Venkatesh Mookkan]
My: Website | Yahoo Group | Blog Spot

GeneralRe: check LAN status Pin
saravanan0520-Jan-08 23:16
saravanan0520-Jan-08 23:16 
GeneralRe: check LAN status Pin
Venkatesh Mookkan21-Jan-08 0:26
Venkatesh Mookkan21-Jan-08 0:26 
GeneralDuplicate Posts. Please ignore Pin
Vasudevan Deepak Kumar20-Jan-08 22:54
Vasudevan Deepak Kumar20-Jan-08 22:54 
QuestionScheduling an occasional server task [modified] Pin
chaiguy133720-Jan-08 15:23
chaiguy133720-Jan-08 15:23 
GeneralRe: Scheduling an occasional server task Pin
N a v a n e e t h20-Jan-08 19:02
N a v a n e e t h20-Jan-08 19:02 
GeneralRe: Scheduling an occasional server task Pin
chaiguy133721-Jan-08 4:19
chaiguy133721-Jan-08 4:19 
GeneralRe: Scheduling an occasional server task Pin
chaiguy133721-Jan-08 4:21
chaiguy133721-Jan-08 4:21 
GeneralPublish an ASP.Net Website Pin
mehrdadc4820-Jan-08 9:08
mehrdadc4820-Jan-08 9:08 
GeneralRe: Publish an ASP.Net Website Pin
pmarfleet20-Jan-08 12:27
pmarfleet20-Jan-08 12:27 
GeneralRe: Publish an ASP.Net Website Pin
Venkatesh Mookkan20-Jan-08 17:53
Venkatesh Mookkan20-Jan-08 17:53 
Generalasp.net and silverlight Pin
smashguitars20-Jan-08 7:18
smashguitars20-Jan-08 7:18 
GeneralRe: asp.net and silverlight Pin
Mike Ellison20-Jan-08 20:22
Mike Ellison20-Jan-08 20:22 
GeneralRe: asp.net and silverlight Pin
Michael Sync21-Jan-08 4:52
Michael Sync21-Jan-08 4:52 
Generalread image from excel file.... Pin
pradeep kumarappagari20-Jan-08 6:06
pradeep kumarappagari20-Jan-08 6:06 
GeneralRe: read image from excel file.... Pin
Paul Conrad20-Jan-08 9:27
professionalPaul Conrad20-Jan-08 9:27 
AnswerRe: read image from excel file.... Pin
mohankatari20-Jan-08 19:59
mohankatari20-Jan-08 19:59 
GeneralRe: read image from excel file.... Pin
pradeep kumarappagari20-Jan-08 20:36
pradeep kumarappagari20-Jan-08 20:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.