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

C#

 
QuestionPDFSHARP - table page break Pin
Mol4ok12-Nov-14 22:19
Mol4ok12-Nov-14 22:19 
AnswerRe: PDFSHARP - table page break Pin
Mol4ok16-Nov-14 15:57
Mol4ok16-Nov-14 15:57 
GeneralRe: PDFSHARP - table page break Pin
Mycroft Holmes16-Nov-14 18:32
professionalMycroft Holmes16-Nov-14 18:32 
GeneralRe: PDFSHARP - table page break Pin
Mol4ok16-Nov-14 21:03
Mol4ok16-Nov-14 21:03 
QuestionCannot access a disposed object. Object name : System.Net.Mail.MailMessage Pin
Jassim Rahma12-Nov-14 20:35
Jassim Rahma12-Nov-14 20:35 
AnswerRe: Cannot access a disposed object. Object name : System.Net.Mail.MailMessage Pin
BillWoodruff12-Nov-14 21:04
professionalBillWoodruff12-Nov-14 21:04 
AnswerRe: Cannot access a disposed object. Object name : System.Net.Mail.MailMessage PinPopular
Bernhard Hiller12-Nov-14 21:10
Bernhard Hiller12-Nov-14 21:10 
AnswerRe: Cannot access a disposed object. Object name : System.Net.Mail.MailMessage Pin
Marco Bertschi13-Nov-14 23:05
protectorMarco Bertschi13-Nov-14 23:05 
The error is at

C#
client.SendAsync(message, userState);
Console.WriteLine("Sending message... press c to cancel mail. Press any other key to exit.");
string answer = Console.ReadLine();
// If the user canceled the send, and mail hasn't been sent yet,
// then cancel the pending operation.

// if (answer.StartsWith("c") && mailSent == false)
// {
    // client.SendAsyncCancel();
// }

// Clean up -->> CAUSES ERROR!
message.Dispose();

SendAsync does nothing else than sending the message asynchronously, meaning that at the point you dispose the message, the asynchrobnous send routine is still trying to access the message object. Leave away the dispose part, since the message is automatically disposed by the Garbage Collector once it isn't in use anymore.

The console is a black place

QuestionAsk Pin
kavnico12-Nov-14 16:50
kavnico12-Nov-14 16:50 
AnswerRe: Ask Pin
BillWoodruff12-Nov-14 20:30
professionalBillWoodruff12-Nov-14 20:30 
AnswerRe: Ask Pin
Richard MacCutchan12-Nov-14 21:22
mveRichard MacCutchan12-Nov-14 21:22 
GeneralRe: Ask Pin
ZurdoDev13-Nov-14 3:07
professionalZurdoDev13-Nov-14 3:07 
GeneralRe: Ask Pin
Richard MacCutchan13-Nov-14 3:10
mveRichard MacCutchan13-Nov-14 3:10 
GeneralRe: Ask Pin
ZurdoDev13-Nov-14 3:19
professionalZurdoDev13-Nov-14 3:19 
QuestionC# FormatCurrency(VB) to ToString Pin
Member 876492812-Nov-14 10:23
Member 876492812-Nov-14 10:23 
AnswerRe: C# FormatCurrency(VB) to ToString Pin
Eddy Vluggen12-Nov-14 10:47
professionalEddy Vluggen12-Nov-14 10:47 
AnswerRe: C# FormatCurrency(VB) to ToString Pin
Pete O'Hanlon12-Nov-14 10:58
mvePete O'Hanlon12-Nov-14 10:58 
GeneralRe: C# FormatCurrency(VB) to ToString Pin
Dominic Burford13-Nov-14 4:25
professionalDominic Burford13-Nov-14 4:25 
GeneralRe: C# FormatCurrency(VB) to ToString Pin
Pete O'Hanlon13-Nov-14 4:49
mvePete O'Hanlon13-Nov-14 4:49 
GeneralRe: C# FormatCurrency(VB) to ToString Pin
Dominic Burford13-Nov-14 5:34
professionalDominic Burford13-Nov-14 5:34 
AnswerRe: C# FormatCurrency(VB) to ToString PinPopular
Dave Kreskowiak12-Nov-14 11:13
mveDave Kreskowiak12-Nov-14 11:13 
GeneralRe: C# FormatCurrency(VB) to ToString Pin
Bernhard Hiller12-Nov-14 21:15
Bernhard Hiller12-Nov-14 21:15 
AnswerRe: C# FormatCurrency(VB) to ToString Pin
Dominic Burford13-Nov-14 5:34
professionalDominic Burford13-Nov-14 5:34 
QuestionStrange thing with AsemblyResolve event Pin
Marcos Bischoff12-Nov-14 4:28
Marcos Bischoff12-Nov-14 4:28 
AnswerRe: Strange thing with AsemblyResolve event Pin
Eddy Vluggen12-Nov-14 8:05
professionalEddy Vluggen12-Nov-14 8: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.