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

C#

 
GeneralIs it possible to declare const array of strings... Pin
Thomas W6-Feb-03 0:04
Thomas W6-Feb-03 0:04 
GeneralRe: Is it possible to declare const array of strings... Pin
SimonS6-Feb-03 0:16
SimonS6-Feb-03 0:16 
GeneralRe: Is it possible to declare const array of strings... Pin
Thomas W6-Feb-03 0:29
Thomas W6-Feb-03 0:29 
Generalusercontrol and lostfocus Pin
Roger Alsing5-Feb-03 20:53
Roger Alsing5-Feb-03 20:53 
GeneralRe: usercontrol and lostfocus Pin
Jeff J6-Feb-03 10:19
Jeff J6-Feb-03 10:19 
QuestionHow can you detect if User IS ONLINE? Pin
cdengler5-Feb-03 20:45
cdengler5-Feb-03 20:45 
AnswerRe: How can you detect if User IS ONLINE? Pin
Anonymous6-Feb-03 2:19
Anonymous6-Feb-03 2:19 
AnswerRe: How can you detect if User IS ONLINE? Pin
John Mautari11-Feb-03 5:08
John Mautari11-Feb-03 5:08 
<br />
using System.Runtime.InteropServices;<br />
<br />
...<br />
<br />
public class InternetConnection<br />
{<br />
	[DllImport("wininet.dll")]<br />
	public static extern bool InternetGetConnectedStateEx(out int lpdwFlags, byte[] szConn, int iConnSize, int dwReserved);<br />
<br />
	/// <summary><br />
	/// Status da conexão<br />
	/// </summary><br />
	public enum Status: int<br />
	{<br />
		/// <summary><br />
		/// Local system uses a modem to connect to the Internet.<br />
		/// </summary><br />
		INTERNET_CONNECTION_MODEM = 1,<br />
		/// <summary><br />
		/// Local system uses a local area network to connect to the Internet.<br />
		/// </summary><br />
        INTERNET_CONNECTION_LAN = 2,<br />
		/// <summary><br />
		/// Local system uses a proxy server to connect to the Internet.<br />
		/// </summary><br />
        INTERNET_CONNECTION_PROXY = 4,<br />
		/// <summary><br />
		/// Local system has RAS installed.<br />
		/// </summary><br />
        INTERNET_RAS_INSTALLED = 16,<br />
		/// <summary><br />
		/// Local system is in offline mode.<br />
		/// </summary><br />
        INTERNET_CONNECTION_OFFLINE = 32,<br />
		/// <summary><br />
		/// Local system has a valid connection to the Internet, but it might or might not be currently connected.<br />
		/// </summary><br />
        INTERNET_CONNECTION_CONFIGURED = 64<br />
	}<br />
<br />
	/// <summary><br />
	/// Returns true if connected<br />
	/// </summary><br />
	public static bool Connected<br />
	{<br />
		get {<br />
			bool bConn = false;<br />
			int flags = 0;<br />
			byte [] cName = new byte[512];<br />
			if(InternetGetConnectedStateEx(out flags, cName, 512, 0)) <br />
			{<br />
				bConn = true;<br />
			}<br />
			return bConn;<br />
		}<br />
	}<br />
				<br />
	public InternetConnection()<br />
	{<br />
	}<br />
}<br />
<br />
...<br />
<br />
InternetConnection inet = new InternetConnection();<br />
if(inet.Connected)<br />
{<br />
...<br />
}<br />
else<br />
{<br />
// not connected<br />
}<br />


Cheers,

John
QuestionHow to autoredraw if I use "graphics" Pin
clarkwuzhe5-Feb-03 17:30
clarkwuzhe5-Feb-03 17:30 
AnswerRe: How to autoredraw if I use "graphics" Pin
Paresh Gheewala5-Feb-03 18:08
Paresh Gheewala5-Feb-03 18:08 
AnswerRe: How to autoredraw if I use "graphics" Pin
Jeff J5-Feb-03 21:56
Jeff J5-Feb-03 21:56 
GeneralRe: How to autoredraw if I use "graphics" Pin
clarkwuzhe6-Feb-03 6:23
clarkwuzhe6-Feb-03 6:23 
GeneralRe: How to autoredraw if I use "graphics" Pin
Jeff J6-Feb-03 9:52
Jeff J6-Feb-03 9:52 
GeneralRe: How to autoredraw if I use "graphics" Pin
clarkwuzhe7-Feb-03 7:08
clarkwuzhe7-Feb-03 7:08 
GeneralRe: How to autoredraw if I use "graphics" Pin
Jeff J7-Feb-03 7:58
Jeff J7-Feb-03 7:58 
GeneralGetting Started in Software Dev. Pin
jtmtv185-Feb-03 14:40
jtmtv185-Feb-03 14:40 
GeneralRe: Getting Started in Software Dev. Pin
Taka Muraoka5-Feb-03 15:12
Taka Muraoka5-Feb-03 15:12 
GeneralRe: Getting Started in Software Dev. Pin
jtmtv185-Feb-03 15:24
jtmtv185-Feb-03 15:24 
GeneralRe: Getting Started in Software Dev. Pin
Taka Muraoka5-Feb-03 15:35
Taka Muraoka5-Feb-03 15:35 
GeneralRe: Getting Started in Software Dev. Pin
jtmtv185-Feb-03 15:47
jtmtv185-Feb-03 15:47 
GeneralRe: Getting Started in Software Dev. Pin
Taka Muraoka5-Feb-03 15:51
Taka Muraoka5-Feb-03 15:51 
Questionhow to get all the files names in one folder? Pin
clarkwuzhe5-Feb-03 11:59
clarkwuzhe5-Feb-03 11:59 
AnswerRe: how to get all the files names in one folder? Pin
Paresh Gheewala5-Feb-03 12:30
Paresh Gheewala5-Feb-03 12:30 
AnswerRe: how to get all the files names in one folder? Pin
Paresh Gheewala5-Feb-03 13:13
Paresh Gheewala5-Feb-03 13:13 
QuestionHow to tell whether a string is a number? Pin
clarkwuzhe5-Feb-03 11:30
clarkwuzhe5-Feb-03 11:30 

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.