Click here to Skip to main content
15,879,535 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: DNN 9.x Internal Server Error Pin
Gerry Schmitz30-May-18 10:00
mveGerry Schmitz30-May-18 10:00 
GeneralRe: DNN 9.x Internal Server Error Pin
Richard Deeming31-May-18 1:23
mveRichard Deeming31-May-18 1:23 
GeneralDotnetnuke Login issue with Citrix SSL Offloading Pin
Member 1380608530-Apr-18 23:41
Member 1380608530-Apr-18 23:41 
GeneralRe: Dotnetnuke Login issue with Citrix SSL Offloading Pin
Pete O'Hanlon30-Apr-18 23:55
mvePete O'Hanlon30-Apr-18 23:55 
QuestionWinForms NIC Performance Counter Pin
Member 1380586930-Apr-18 20:05
Member 1380586930-Apr-18 20:05 
SuggestionRe: WinForms NIC Performance Counter Pin
Richard Deeming1-May-18 1:19
mveRichard Deeming1-May-18 1:19 
GeneralRe: WinForms NIC Performance Counter Pin
Member 138058691-May-18 1:28
Member 138058691-May-18 1:28 
GeneralRe: WinForms NIC Performance Counter Pin
Richard Deeming1-May-18 1:32
mveRichard Deeming1-May-18 1:32 
GeneralRe: WinForms NIC Performance Counter Pin
Member 138058691-May-18 1:33
Member 138058691-May-18 1:33 
Questiontextbox input Pin
User 136751143-Mar-18 13:03
User 136751143-Mar-18 13:03 
AnswerRe: textbox input Pin
Richard MacCutchan3-Mar-18 21:11
mveRichard MacCutchan3-Mar-18 21:11 
AnswerRe: textbox input Pin
User 418025417-Jun-18 3:54
User 418025417-Jun-18 3:54 
QuestionWhat is best Online Decompiler For Exe Code Reverse( C# and delphi) Pin
Member 134632896-Nov-17 21:29
Member 134632896-Nov-17 21:29 
AnswerRe: What is best Online Decompiler For Exe Code Reverse( C# and delphi) Pin
AdrianG00116-Apr-18 4:38
AdrianG00116-Apr-18 4:38 
QuestionWinforms VS 2015 Community with encrypted SQLite Pin
Member 1271965811-Jan-17 3:08
Member 1271965811-Jan-17 3:08 
QuestionAddind hide information to a file of NTFS Pin
Alex Can Work4-Jan-17 18:35
Alex Can Work4-Jan-17 18:35 
AnswerRe: Addind hide information to a file of NTFS Pin
Midi_Mick4-Jan-17 19:27
professionalMidi_Mick4-Jan-17 19:27 
GeneralRe: Addind hide information to a file of NTFS Pin
Richard MacCutchan4-Jan-17 22:02
mveRichard MacCutchan4-Jan-17 22:02 
AnswerRe: Addind hide information to a file of NTFS Pin
Richard MacCutchan4-Jan-17 22:02
mveRichard MacCutchan4-Jan-17 22:02 
QuestionWindows server OnTimedEvent Pin
byka24-Oct-16 5:40
byka24-Oct-16 5:40 
AnswerRe: Windows server OnTimedEvent Pin
Eddy Vluggen24-Oct-16 6:13
professionalEddy Vluggen24-Oct-16 6:13 
GeneralRe: Windows server OnTimedEvent Pin
byka24-Oct-16 6:38
byka24-Oct-16 6:38 
GeneralRe: Windows server OnTimedEvent Pin
Eddy Vluggen24-Oct-16 7:23
professionalEddy Vluggen24-Oct-16 7:23 
GeneralRe: Windows server OnTimedEvent Pin
byka24-Oct-16 7:26
byka24-Oct-16 7:26 
GeneralRe: Windows server OnTimedEvent Pin
Eddy Vluggen24-Oct-16 7:54
professionalEddy Vluggen24-Oct-16 7:54 
byka wrote:
I am not sure I am clear on what you have in mind
My bad; but you're complicating the problem by thinking about emails. In these cases its easier to start a new project and make a sketch of what you'd need. Example below, for a console-application.

VB
Module Module1
    Public Function MyEmailMethod() As Int32        
        ' we throw an exception, to test the handling and the retrying thereof.
        ' in the actual application an email would be sent from here.
        Throw New NotImplementedException("test")
    End Function

    Public Function TryMyEmailMethod(maxTries As Integer, Optional currentTry As Integer = 1) As Int32
        If currentTry <= maxTries Then
            Try
                Console.WriteLine(String.Format("Attempt {0}", currentTry))
                MyEmailMethod()
            Catch ex As Exception
                Console.WriteLine("Caught: " + ex.GetType().Name)
                TryMyEmailMethod(maxTries, currentTry + 1)
            End Try
        Else
            Console.WriteLine("I've tried enough, that damn server is ignoring me!")
        End If
    End Function

    Sub Main()
        TryMyEmailMethod(3)

        'halt execution to show result
        Console.ReadKey()
    End Sub
End Module
That would result in below output if you run it, showing the principle works as intended;
Attempt 1
Caught: NotImplementedException
Attempt 2
Caught: NotImplementedException
Attempt 3
Caught: NotImplementedException
I've tried enough, that damn server is ignoring me!
Your "NotImplementedException" would be the exception that the mail-routine is throwing, and you might want to log the lines where the above code is writing to the console; after all, if a mail-server stops responding, you'd like to verify that everything else worked as expected.

Making a new project allows to focus on the problem, without anything else bothering. It also makes reuse of the new pattern somewhat easier, IMO. Also take not that above code could encounter three different exceptions or reasons why it cannot send mail, without it giving much info yet on why.
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

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.