Click here to Skip to main content
15,914,222 members
Home / Discussions / C#
   

C#

 
GeneralRe: Create controls form text file? Pin
greyzz13-Oct-06 18:20
greyzz13-Oct-06 18:20 
GeneralRe: Create controls form text file? Pin
Nader Elshehabi14-Oct-06 2:52
Nader Elshehabi14-Oct-06 2:52 
QuestionAutomatic capitalization in VS2003 ? Pin
digsy_13-Oct-06 11:30
digsy_13-Oct-06 11:30 
AnswerRe: Automatic capitalization in VS2003 ? Pin
Wjousts13-Oct-06 11:53
Wjousts13-Oct-06 11:53 
GeneralRe: Automatic capitalization in VS2003 ? Pin
digsy_13-Oct-06 12:06
digsy_13-Oct-06 12:06 
GeneralRe: Automatic capitalization in VS2003 ? Pin
Kevin McFarlane13-Oct-06 12:47
Kevin McFarlane13-Oct-06 12:47 
QuestionHandling encryption at the application level Pin
kennk13-Oct-06 11:16
kennk13-Oct-06 11:16 
QuestionI cannot establish a connection to pop3 server !!! Pin
mohadcs13-Oct-06 11:12
mohadcs13-Oct-06 11:12 
i use a class writen by Peter Huber, for pop3 client but i have a problem with it
I cannot establish a connection throw a proxy but when i use direct connection "not firewalled or proxy environment" its work good , are there any changes must done on this method ( connect() )???? or any help please:
Sigh | :sigh: Sigh | :sigh: Sigh | :sigh: Sigh | :sigh: Sigh | :sigh: Sigh | :sigh:

public void Connect() {
if (pop3ConnectionState!=Pop3ConnectionStateEnum.Disconnected &&
pop3ConnectionState!=Pop3ConnectionStateEnum.Closed &&
!isTimeoutReconnect) {
CallWarning("connect", "", "Connect command received, but connection state is: " + pop3ConnectionState.ToString());
} else {
//establish TCP connection
try {
CallTrace(" Connect at port {0}", port);
serverTcpConnection = new TcpClient(popServer, port);
} catch (Exception ex) {
throw new Pop3Exception("Connection to server "+ popServer + ", port " + port + " failed.\nRuntime Error: "+ex.ToString());
}

if (useSSL) {
//get SSL stream
try {
CallTrace(" Get SSL connection");
pop3Stream = new SslStream(serverTcpConnection.GetStream(), false);
pop3Stream.ReadTimeout = readTimeout;
} catch (Exception ex) {
throw new Pop3Exception("Server " + popServer + " found, but cannot get SSL data stream.\nRuntime Error: "+ex.ToString());
}

//perform SSL authentication
try {
CallTrace(" Get SSL authentication");
((SslStream)pop3Stream).AuthenticateAsClient(popServer);
} catch (Exception ex) {
throw new Pop3Exception("Server " + popServer + " found, but problem with SSL Authentication.\nRuntime Error: " + ex.ToString());
}
} else {
//create a stream to POP3 server without using SSL
try {
CallTrace(" Get connection without SSL");
pop3Stream = serverTcpConnection.GetStream();
pop3Stream.ReadTimeout = readTimeout;
} catch (Exception ex) {
throw new Pop3Exception("Server " + popServer + " found, but cannot get data stream (without SSL).\nRuntime Error: "+ex.ToString());
}
}
//get stream for reading from pop server
//POP3 allows only US-ASCII. The message will be translated in the proper encoding in a later step
try {
pop3StreamReader= new StreamReader(pop3Stream, Encoding.ASCII);
} catch (Exception ex) {
if (useSSL) {
throw new Pop3Exception("Server " + popServer + " found, but cannot read from SSL stream.\nRuntime Error: " + ex.ToString());
} else {
throw new Pop3Exception("Server " + popServer + " found, but cannot read from stream (without SSL).\nRuntime Error: " + ex.ToString());
}
}

//ready for authorisation
string response;
if (!readSingleLine(out response)) {
throw new Pop3Exception("Server " + popServer + " not ready to start AUTHORIZATION.\nMessage: " + response);
}
setPop3ConnectionState(Pop3ConnectionStateEnum.Authorization);

//send user name
if (!executeCommand("USER "+ username, out response)) {
throw new Pop3Exception("Server " + popServer + " doesn't accept username '" + username + "'.\nMessage: " + response);
}

//send password
if (!executeCommand("PASS " + password, out response)) {
throw new Pop3Exception("Server " + popServer + " doesn't accept password '" + password + "' for user '" + username + "'.\nMessage: " + response);
}

setPop3ConnectionState(Pop3ConnectionStateEnum.Connected);
}
}
Sigh | :sigh: Sigh | :sigh: Sigh | :sigh:
QuestionDoc File Display Pin
Syed Shahid Hussain13-Oct-06 10:58
Syed Shahid Hussain13-Oct-06 10:58 
AnswerRe: Doc File Display Pin
Nader Elshehabi13-Oct-06 12:35
Nader Elshehabi13-Oct-06 12:35 
GeneralRe: Doc File Display Pin
Syed Shahid Hussain13-Oct-06 20:38
Syed Shahid Hussain13-Oct-06 20:38 
Questioncreating prime events for a control Pin
Nadia Monalisa13-Oct-06 9:24
Nadia Monalisa13-Oct-06 9:24 
AnswerRe: creating prime events for a control Pin
Wjousts13-Oct-06 10:34
Wjousts13-Oct-06 10:34 
GeneralRe: creating prime events for a control Pin
Nadia Monalisa13-Oct-06 10:41
Nadia Monalisa13-Oct-06 10:41 
AnswerRe: creating prime events for a control Pin
Nader Elshehabi13-Oct-06 12:05
Nader Elshehabi13-Oct-06 12:05 
QuestionMonitor Browser Externally Pin
Victor M. Bello A.13-Oct-06 8:07
Victor M. Bello A.13-Oct-06 8:07 
AnswerRe: Monitor Browser Externally Pin
Victor M. Bello A.13-Oct-06 9:36
Victor M. Bello A.13-Oct-06 9:36 
AnswerRe: Monitor Browser Externally Pin
seannyc13-Oct-06 10:32
seannyc13-Oct-06 10:32 
GeneralRe: Monitor Browser Externally Pin
Victor M. Bello A.16-Oct-06 6:57
Victor M. Bello A.16-Oct-06 6:57 
QuestionKeeping track of ID information with a TreeView Pin
shultas13-Oct-06 7:41
shultas13-Oct-06 7:41 
AnswerRe: Keeping track of ID information with a TreeView Pin
mav.northwind13-Oct-06 9:18
mav.northwind13-Oct-06 9:18 
GeneralRe: Keeping track of ID information with a TreeView Pin
shultas13-Oct-06 11:45
shultas13-Oct-06 11:45 
QuestionString.Trim error Pin
User 309585913-Oct-06 7:13
User 309585913-Oct-06 7:13 
AnswerRe: String.Trim error Pin
Christian Graus13-Oct-06 7:22
protectorChristian Graus13-Oct-06 7:22 
GeneralRe: String.Trim error Pin
User 309585913-Oct-06 7:28
User 309585913-Oct-06 7:28 

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.