Click here to Skip to main content
15,887,175 members
Home / Discussions / C#
   

C#

 
AnswerIgnore repost Pin
Manas Bhardwaj29-Jun-09 22:00
professionalManas Bhardwaj29-Jun-09 22:00 
QuestionCreate database in windows mobile but dont create password Pin
khosnur29-Jun-09 18:48
khosnur29-Jun-09 18:48 
AnswerRe: Create database in windows mobile but dont create password Pin
himanshu256129-Jun-09 20:57
himanshu256129-Jun-09 20:57 
QuestionCreate Custom Control Pin
satsumatable29-Jun-09 17:34
satsumatable29-Jun-09 17:34 
AnswerRe: Create Custom Control Pin
dan!sh 29-Jun-09 17:50
professional dan!sh 29-Jun-09 17:50 
GeneralRe: Create Custom Control Pin
Rajesh R Subramanian29-Jun-09 22:39
professionalRajesh R Subramanian29-Jun-09 22:39 
GeneralRe: Create Custom Control Pin
EliottA30-Jun-09 2:55
EliottA30-Jun-09 2:55 
QuestionNetwork connections detecting Pin
steve_rm29-Jun-09 14:51
steve_rm29-Jun-09 14:51 
Hello,

VS 2008 SP1

I am using the code below to test whether the user is connected using either a wireless or LAN connection. i.e. that the cable is plugged in, or the wireless is switch off. The code works fine for this. However, if you can spot any potential problems with this or you know of a better way I would be interested to learn more.

However, the client would like us to check if the user is connected using a modem as well. As you can see from my source code I am looking for connection that start with either "Local Area Connection" or "Wireless Network Connection". This is ok.

However, the problem is that the modem name could be anything, as when the user sets up their modem connection using the 'new connection wizard' they can call this anything. So if my switch statement I don't know what to look for.

Any suggestions would be most helpfull,

// Checks if Network is either connected by LAN or Wireless
        public bool IsNetworkConnected()
        {
            NetworkInterface[] networkCards = NetworkInterface.GetAllNetworkInterfaces();
            bool connected = false;

            // Loop through to find the one we want to check for connectivity.
            // Connection can have different numbers appended so check that the 
            // network connections start with the conditions checked below.
            foreach (NetworkInterface nc in networkCards)
            {
                // Check LAN
                if (nc.Name.StartsWith("Local Area Connection"))
                {
                    if (nc.OperationalStatus == OperationalStatus.Up)
                    {
                        connected = true;
                    }
                }

                // Check for Wireless
                if (nc.Name.StartsWith("Wireless Network Connection"))
                {
                    if (nc.OperationalStatus == OperationalStatus.Up)
                    {
                        connected = true;
                    }
                }
            }

            return connected;
        }

AnswerRe: Network connections detecting Pin
Eslam Afifi29-Jun-09 16:44
Eslam Afifi29-Jun-09 16:44 
QuestionProper way of creating a form with multiple pages Pin
shultas29-Jun-09 14:16
shultas29-Jun-09 14:16 
AnswerRe: Proper way of creating a form with multiple pages Pin
Christian Graus29-Jun-09 14:58
protectorChristian Graus29-Jun-09 14:58 
GeneralRe: Proper way of creating a form with multiple pages Pin
shultas29-Jun-09 15:39
shultas29-Jun-09 15:39 
GeneralRe: Proper way of creating a form with multiple pages Pin
Christian Graus29-Jun-09 15:54
protectorChristian Graus29-Jun-09 15:54 
GeneralRe: Proper way of creating a form with multiple pages Pin
shultas29-Jun-09 15:58
shultas29-Jun-09 15:58 
GeneralRe: Proper way of creating a form with multiple pages Pin
Christian Graus29-Jun-09 16:19
protectorChristian Graus29-Jun-09 16:19 
GeneralRe: Proper way of creating a form with multiple pages Pin
EliottA29-Jun-09 15:51
EliottA29-Jun-09 15:51 
QuestionNeed to search a webpage for a word OR search links in it Pin
p3rson29-Jun-09 12:47
p3rson29-Jun-09 12:47 
AnswerRe: Need to search a webpage for a word OR search links in it Pin
scottgp29-Jun-09 13:38
professionalscottgp29-Jun-09 13:38 
AnswerRe: Need to search a webpage for a word OR search links in it Pin
EliottA29-Jun-09 13:49
EliottA29-Jun-09 13:49 
GeneralRe: Need to search a webpage for a word OR search links in it Pin
p3rson29-Jun-09 22:39
p3rson29-Jun-09 22:39 
GeneralRe: Need to search a webpage for a word OR search links in it Pin
J4amieC29-Jun-09 23:19
J4amieC29-Jun-09 23:19 
GeneralRe: Need to search a webpage for a word OR search links in it Pin
DaveyM6929-Jun-09 23:33
professionalDaveyM6929-Jun-09 23:33 
GeneralRe: Need to search a webpage for a word OR search links in it Pin
EliottA30-Jun-09 2:45
EliottA30-Jun-09 2:45 
AnswerRe: Need to search a webpage for a word OR search links in it Pin
p3rson30-Jun-09 8:53
p3rson30-Jun-09 8:53 
QuestionProblem with reading excel 2007. Pin
hdv21229-Jun-09 12:43
hdv21229-Jun-09 12:43 

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.