Click here to Skip to main content
15,886,806 members
Home / Discussions / C#
   

C#

 
GeneralRe: Why changing the CurrentCulture.DateTimeFormat.ShortTimePattern doesn't affect the DateTime.now format Pin
DaveyM6914-Oct-09 22:33
professionalDaveyM6914-Oct-09 22:33 
GeneralRe: Why changing the CurrentCulture.DateTimeFormat.ShortTimePattern doesn't affect the DateTime.now format Pin
Richard MacCutchan14-Oct-09 22:36
mveRichard MacCutchan14-Oct-09 22:36 
QuestionList Objects to Xml Method Pin
AndyASPVB14-Oct-09 9:08
AndyASPVB14-Oct-09 9:08 
AnswerRe: List Objects to Xml Method Pin
DaveyM6914-Oct-09 9:22
professionalDaveyM6914-Oct-09 9:22 
GeneralRe: List Objects to Xml Method Pin
AndyASPVB14-Oct-09 9:41
AndyASPVB14-Oct-09 9:41 
GeneralRe: List Objects to Xml Method Pin
Not Active14-Oct-09 10:18
mentorNot Active14-Oct-09 10:18 
GeneralRe: List Objects to Xml Method Pin
DaveyM6914-Oct-09 10:20
professionalDaveyM6914-Oct-09 10:20 
Questionerror sending email using Networkcredential Pin
Jassim Rahma14-Oct-09 8:32
Jassim Rahma14-Oct-09 8:32 
I am trying to send an email from Windows Application (C#) through my host email but getting the following error message after a long time waiting:

ContextSwitchDeadlock was detected

Message: The CLR has been unable to transition from COM context 0x3b3f18 to COM context 0x3b3da8 for 60 seconds.
The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing
a very long running operation without pumping Windows messages. This situation generally has a negative performance
impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time.
To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives
(such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.


here is my code:

string msg = null;

msg = Environment.NewLine + Environment.NewLine;

msg += "TICS User Details" + txtInternetCafe.Text + Environment.NewLine + Environment.NewLine;

msg += "Cafe Name: " + txtInternetCafe.Text + Environment.NewLine + Environment.NewLine;

msg += "Country: " + cboCountry.Text + Environment.NewLine + Environment.NewLine;

msg += "Telephone: " + txtTelephone.Text + Environment.NewLine + Environment.NewLine;

msg += "Email Address: " + txtEmailAddress.Text + Environment.NewLine + Environment.NewLine;

msg += "CPU Serial: " + get_cpu_serial() + Environment.NewLine + Environment.NewLine;



MailAddress mail_from = new MailAddress(txtEmailAddress.Text, txtInternetCafe.Text);

MailAddress mail_to = new MailAddress("EMAIL REMOVED", "JassimRahma.com");



MailMessage mail_message = new MailMessage();

mail_message.From = mail_from;

mail_message.To.Add(mail_to);

mail_message.Subject = "TICS - Registration Request";

mail_message.IsBodyHtml = true;

mail_message.Body = msg;



SmtpClient smtp_client = new SmtpClient("mail.mishkah.org");



NetworkCredential login_info = new NetworkCredential("EMAIL REMOVED", "xxxxx");



smtp_client.UseDefaultCredentials = false;

smtp_client.Credentials = login_info;



smtp_client.Send(mail_message);

mail_message.Dispose();

AnswerRe: error sending email using Networkcredential Pin
Abhijit Jana14-Oct-09 8:42
professionalAbhijit Jana14-Oct-09 8:42 
GeneralRe: error sending email using Networkcredential Pin
Jassim Rahma14-Oct-09 9:41
Jassim Rahma14-Oct-09 9:41 
GeneralRe: error sending email using Networkcredential Pin
Abhijit Jana14-Oct-09 17:18
professionalAbhijit Jana14-Oct-09 17:18 
QuestionXML VALIDATION Pin
waqasm14-Oct-09 8:23
waqasm14-Oct-09 8:23 
QuestionC# console application to dll and register..... Pin
greendragons14-Oct-09 8:20
greendragons14-Oct-09 8:20 
AnswerRe: C# console application to dll and register..... Pin
Dave Kreskowiak14-Oct-09 8:28
mveDave Kreskowiak14-Oct-09 8:28 
GeneralRe: C# console application to dll and register..... Pin
greendragons14-Oct-09 8:31
greendragons14-Oct-09 8:31 
GeneralRe: C# console application to dll and register..... Pin
DaveyM6914-Oct-09 8:38
professionalDaveyM6914-Oct-09 8:38 
GeneralRe: C# console application to dll and register..... Pin
greendragons14-Oct-09 8:46
greendragons14-Oct-09 8:46 
GeneralRe: C# console application to dll and register..... Pin
Dave Kreskowiak14-Oct-09 8:59
mveDave Kreskowiak14-Oct-09 8:59 
GeneralRe: C# console application to dll and register..... Pin
greendragons14-Oct-09 9:04
greendragons14-Oct-09 9:04 
QuestionProblem changing text on from lable from another class [modified] Pin
yogi_bear_7914-Oct-09 6:20
yogi_bear_7914-Oct-09 6:20 
AnswerRe: Problem changing text on from lable from another class Pin
Dave Kreskowiak14-Oct-09 6:38
mveDave Kreskowiak14-Oct-09 6:38 
GeneralRe: Problem changing text on from lable from another class Pin
yogi_bear_7914-Oct-09 8:02
yogi_bear_7914-Oct-09 8:02 
GeneralRe: Problem changing text on from lable from another class Pin
DaveyM6914-Oct-09 8:05
professionalDaveyM6914-Oct-09 8:05 
GeneralRe: Problem changing text on from lable from another class Pin
yogi_bear_7914-Oct-09 8:42
yogi_bear_7914-Oct-09 8:42 
GeneralRe: Problem changing text on from lable from another class Pin
DaveyM6914-Oct-09 9:05
professionalDaveyM6914-Oct-09 9:05 

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.