Click here to Skip to main content
15,906,173 members
Home / Discussions / C#
   

C#

 
Questionwhy not escape to catch an error when i next run? Pin
Member 245846723-Feb-17 2:18
Member 245846723-Feb-17 2:18 
AnswerRe: why not escape to catch an error when i next run? Pin
OriginalGriff23-Feb-17 2:40
mveOriginalGriff23-Feb-17 2:40 
GeneralRe: why not escape to catch an error when i next run? Pin
Member 245846723-Feb-17 16:08
Member 245846723-Feb-17 16:08 
GeneralRe: why not escape to catch an error when i next run? Pin
OriginalGriff23-Feb-17 20:35
mveOriginalGriff23-Feb-17 20:35 
GeneralRe: why not escape to catch an error when i next run? Pin
Member 24584672-Mar-17 16:03
Member 24584672-Mar-17 16:03 
AnswerRe: why not escape to catch an error when i next run? Pin
Eddy Vluggen23-Feb-17 2:43
professionalEddy Vluggen23-Feb-17 2:43 
QuestionVS c# 2015 Setup Project: How to force Rollback before commit on my own condition Pin
nemo1423-Feb-17 1:07
nemo1423-Feb-17 1:07 
AnswerRe: VS c# 2015 Setup Project: How to force Rollback before commit on my own condition Pin
OriginalGriff23-Feb-17 1:22
mveOriginalGriff23-Feb-17 1:22 
AnswerRe: VS c# 2015 Setup Project: How to force Rollback before commit on my own condition Pin
Bernhard Hiller23-Feb-17 21:39
Bernhard Hiller23-Feb-17 21:39 
QuestionC# Winform: Slide show is not working when i use Quartz.net to fire my routine at specific time Pin
Tridip Bhattacharjee22-Feb-17 23:01
professionalTridip Bhattacharjee22-Feb-17 23:01 
AnswerRe: C# Winform: Slide show is not working when i use Quartz.net to fire my routine at specific time Pin
Pete O'Hanlon22-Feb-17 23:32
mvePete O'Hanlon22-Feb-17 23:32 
AnswerRe: C# Winform: Slide show is not working when i use Quartz.net to fire my routine at specific time Pin
Gerry Schmitz23-Feb-17 9:44
mveGerry Schmitz23-Feb-17 9:44 
QuestionSpell checker for c# project Pin
Ramesh Tigapuram21-Feb-17 22:14
Ramesh Tigapuram21-Feb-17 22:14 
AnswerRe: Spell checker for c# project Pin
Richard MacCutchan21-Feb-17 23:18
mveRichard MacCutchan21-Feb-17 23:18 
AnswerRe: Spell checker for c# project Pin
Pete O'Hanlon21-Feb-17 23:19
mvePete O'Hanlon21-Feb-17 23:19 
QuestionSea trying to change the RichTextBox does not work ? Pin
Member 245846721-Feb-17 18:59
Member 245846721-Feb-17 18:59 
AnswerRe: Sea trying to change the RichTextBox does not work ? Pin
Pete O'Hanlon21-Feb-17 21:27
mvePete O'Hanlon21-Feb-17 21:27 
QuestionPrinting arabic from epson TM-T88V VB.NET, C# Pin
aliraza156721-Feb-17 2:02
professionalaliraza156721-Feb-17 2:02 
AnswerRe: Printing arabic from epson TM-T88V VB.NET, C# Pin
Jochen Arndt21-Feb-17 2:48
professionalJochen Arndt21-Feb-17 2:48 
AnswerRe: Printing arabic from epson TM-T88V VB.NET, C# Pin
tiochus23-Feb-17 22:26
tiochus23-Feb-17 22:26 
QuestionVerify Email problem with AdminControler.cs Pin
John Nederveen20-Feb-17 9:08
John Nederveen20-Feb-17 9:08 
AnswerRe: Verify Email problem with AdminControler.cs Pin
Afzaal Ahmad Zeeshan20-Feb-17 11:09
professionalAfzaal Ahmad Zeeshan20-Feb-17 11:09 
It is really very hard to understand why,
Globals.SendMail(user.Email, "Verify your " + Globals.APPNAME + " membership.", eml);
fails in your application. But in any case, we are not able to help you out by just reading the code out. We need more information, such as the email address or the service being used.

In case of the email, what is the reason for it not being sent, or any error message? Did you try using the following code? In your own code, what happens is that the code creates a new task in the pool, and then returns a task object for that. However, as soon as the last line gets hit your reference is lost and (maybe, maybe...) your code is unable to proceed to send an email. That is why, I am going to write the code that actually waits for a task to finish.
C#
Task task = Task.Run(() =>
            {
                //Send verification email
                string eml = System.IO.File.ReadAllText(Server.MapPath("~/app_data/verifymail.txt"));
                eml = eml.Replace("[username]", user.Name);
                eml = eml.Replace("[appname]", Globals.APPNAME);
                eml = eml.Replace("[vericode]", user.ResetCode);
                eml = eml.Replace("[appurl]", Globals.APPURL);
                eml = eml.Replace("[userid]", user.ID.ToString());

                Globals.SendMail(user.Email, "Verify your " + Globals.APPNAME + " membership.", eml);
            });
task.Wait(); // Wait for it to finish.

Read this as well, Task.Run Method (Action) (System.Threading.Tasks)
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~

GeneralRe: Verify Email problem with AdminControler.cs Pin
John Nederveen20-Feb-17 12:57
John Nederveen20-Feb-17 12:57 
SuggestionRe: Verify Email problem with AdminControler.cs Pin
Afzaal Ahmad Zeeshan20-Feb-17 22:49
professionalAfzaal Ahmad Zeeshan20-Feb-17 22:49 
GeneralRe: Verify Email problem with AdminControler.cs Pin
John Nederveen21-Feb-17 6:03
John Nederveen21-Feb-17 6:03 

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.