Click here to Skip to main content
15,892,072 members
Home / Discussions / C#
   

C#

 
GeneralRe: Retrieve form variable name Pin
genisyssoftware9-Oct-09 3:59
genisyssoftware9-Oct-09 3:59 
GeneralRe: Retrieve form variable name Pin
Luc Pattyn9-Oct-09 4:22
sitebuilderLuc Pattyn9-Oct-09 4:22 
GeneralRe: Retrieve form variable name Pin
genisyssoftware19-Oct-09 9:59
genisyssoftware19-Oct-09 9:59 
GeneralRe: Retrieve form variable name Pin
Luc Pattyn19-Oct-09 10:08
sitebuilderLuc Pattyn19-Oct-09 10:08 
GeneralRe: Retrieve form variable name Pin
genisyssoftware19-Oct-09 12:19
genisyssoftware19-Oct-09 12:19 
GeneralRe: Retrieve form variable name Pin
Luc Pattyn19-Oct-09 12:33
sitebuilderLuc Pattyn19-Oct-09 12:33 
QuestionChecking Connection C# Pin
eawedat7-Oct-09 11:22
eawedat7-Oct-09 11:22 
AnswerRe: Checking Connection C# Pin
Luc Pattyn7-Oct-09 11:54
sitebuilderLuc Pattyn7-Oct-09 11:54 
Hi,

you can use P/Invoke and some Win32 functions to get Internet connection info; this:

enum LP_InternetConnectionState : int {
    /// <summary>Local system has a valid connection to the Internet, but it might
    /// or might not be currently connected.</summary>
    Configured=0x40,
    /// <summary>Local system uses a local area network to connect to the Internet.</summary>
    LAN=0x02,
    /// <summary>Local system uses a modem to connect to the Internet.</summary>
    Modem=0x01,
    /// <summary>Local system is in offline mode.</summary>
    OffLine=0x20,
    /// <summary>Local system uses a proxy server to connect to the Internet.</summary>
    Proxy=0x04,
    /// <summary>Local system has RAS installed.</summary>
    RAS_installed=0x10
}

public static bool Connected() {
    LP_InternetConnectionState description=0;
    return InternetGetConnectedState(ref description, 0);
}

public static string ConnectionName {
    get {
        LP_InternetConnectionState description=0;
        StringBuilder sb=new StringBuilder(512);
        InternetGetConnectedStateEx(ref description, sb, sb.Capacity, 0);
        return sb.ToString()+" ("+description.ToString()+")";
    }
}

[DllImport("wininet.dll")]
static extern bool InternetGetConnectedState(ref LP_InternetConnectionState lpdwFlags,
    int dwReserved);

[DllImport("wininet.dll")]
static extern bool InternetGetConnectedStateEx(ref LP_InternetConnectionState lpdwFlags,
    StringBuilder name, int nameLength, int dwReserved);


should get you started.

Smile | :)

Luc Pattyn

I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages

Local announcement (Antwerp region): Lange Wapper? Neen!


QuestionSAConnection String Pin
MWRivera7-Oct-09 10:54
MWRivera7-Oct-09 10:54 
AnswerRe: SAConnection String Pin
Henry Minute7-Oct-09 11:02
Henry Minute7-Oct-09 11:02 
GeneralRe: SAConnection String Pin
MWRivera8-Oct-09 3:39
MWRivera8-Oct-09 3:39 
GeneralRe: SAConnection String Pin
Henry Minute8-Oct-09 3:47
Henry Minute8-Oct-09 3:47 
GeneralRe: SAConnection String Pin
MWRivera8-Oct-09 5:02
MWRivera8-Oct-09 5:02 
GeneralRe: SAConnection String Pin
Henry Minute8-Oct-09 5:28
Henry Minute8-Oct-09 5:28 
Questionautocad c# and robot Pin
kalidG7-Oct-09 9:32
kalidG7-Oct-09 9:32 
AnswerRe: autocad c# and robot Pin
Christian Graus7-Oct-09 9:59
protectorChristian Graus7-Oct-09 9:59 
QuestionProblem with using "out" in void methods Pin
AndyASPVB7-Oct-09 8:58
AndyASPVB7-Oct-09 8:58 
AnswerRe: Problem with using "out" in void methods Pin
Luc Pattyn7-Oct-09 9:08
sitebuilderLuc Pattyn7-Oct-09 9:08 
AnswerRe: Problem with using "out" in void methods Pin
Mirko19807-Oct-09 10:09
Mirko19807-Oct-09 10:09 
GeneralRe: Problem with using "out" in void methods Pin
AndyASPVB7-Oct-09 12:00
AndyASPVB7-Oct-09 12:00 
GeneralRe: Problem with using "out" in void methods Pin
Not Active7-Oct-09 12:14
mentorNot Active7-Oct-09 12:14 
AnswerRe: Problem with using "out" in void methods Pin
Saksida Bojan7-Oct-09 10:12
Saksida Bojan7-Oct-09 10:12 
Questionweb and window applications that work on one same database file Pin
Djtech017-Oct-09 8:31
Djtech017-Oct-09 8:31 
AnswerRe: web and window applications that work on one same database file Pin
Christian Graus7-Oct-09 10:00
protectorChristian Graus7-Oct-09 10:00 
GeneralRe: web and window applications that work on one same database file Pin
Djtech018-Oct-09 6:53
Djtech018-Oct-09 6:53 

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.