Click here to Skip to main content
14,771,127 members
Home » Discussions » Windows Forms
   

Windows Forms

 
GeneralRe: Addind hide information to a file of NTFS Pin
Richard MacCutchan4-Jan-17 23:02
mveRichard MacCutchan4-Jan-17 23:02 
AnswerRe: Addind hide information to a file of NTFS Pin
Richard MacCutchan4-Jan-17 23:02
mveRichard MacCutchan4-Jan-17 23:02 
QuestionWindows server OnTimedEvent Pin
byka24-Oct-16 6:40
Memberbyka24-Oct-16 6:40 
AnswerRe: Windows server OnTimedEvent Pin
Eddy Vluggen24-Oct-16 7:13
professionalEddy Vluggen24-Oct-16 7:13 
GeneralRe: Windows server OnTimedEvent Pin
byka24-Oct-16 7:38
Memberbyka24-Oct-16 7:38 
GeneralRe: Windows server OnTimedEvent Pin
Eddy Vluggen24-Oct-16 8:23
professionalEddy Vluggen24-Oct-16 8:23 
GeneralRe: Windows server OnTimedEvent Pin
byka24-Oct-16 8:26
Memberbyka24-Oct-16 8:26 
GeneralRe: Windows server OnTimedEvent Pin
Eddy Vluggen24-Oct-16 8:54
professionalEddy Vluggen24-Oct-16 8: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.

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[^]

GeneralRe: Windows server OnTimedEvent Pin
bogel bogel11-Dec-16 1:27
Memberbogel bogel11-Dec-16 1:27 
GeneralRe: Windows server OnTimedEvent Pin
Eddy Vluggen11-Dec-16 1:32
professionalEddy Vluggen11-Dec-16 1:32 
QuestionHow to secure local database for windows form c# Deploy Pin
salar136928-Jun-16 7:46
Membersalar136928-Jun-16 7:46 
AnswerRe: How to secure local database for windows form c# Deploy Pin
Eddy Vluggen28-Jun-16 8:06
professionalEddy Vluggen28-Jun-16 8:06 
AnswerRe: How to secure local database for windows form c# Deploy Pin
Eric P Schneider28-Jan-19 11:53
MemberEric P Schneider28-Jan-19 11:53 
QuestionAdd Code Singning Certificate to Project Setup created using Install Shield in Visual Studio 2012. Pin
Jaimesh.241112-May-16 1:49
MemberJaimesh.241112-May-16 1:49 
Rant[REPOST] Add Code Singning Certificate to Project Setup created using Install Shield in Visual Studio 2012. Pin
Richard Deeming12-May-16 3:04
mveRichard Deeming12-May-16 3:04 
QuestionWindows Client for my portal. Pin
ashu20014-Mar-16 20:28
Memberashu20014-Mar-16 20:28 
GeneralRe: Windows Client for my portal. Pin
Richard MacCutchan4-Mar-16 23:12
mveRichard MacCutchan4-Mar-16 23:12 
GeneralRe: Windows Client for my portal. Pin
ashu20017-Mar-16 19:30
Memberashu20017-Mar-16 19:30 
GeneralRe: Windows Client for my portal. Pin
Richard MacCutchan7-Mar-16 22:56
mveRichard MacCutchan7-Mar-16 22:56 
AnswerRe: Windows Client for my portal. Pin
lw@zi 7-Mar-16 19:59
professional lw@zi 7-Mar-16 19:59 
GeneralRe: Windows Client for my portal. Pin
ashu20018-Mar-16 17:46
Memberashu20018-Mar-16 17:46 
GeneralRe: Windows Client for my portal. Pin
lw@zi 8-Mar-16 18:30
professional lw@zi 8-Mar-16 18:30 
AnswerRe: Windows Client for my portal. Pin
ellegonzalez5-Jan-17 5:54
Memberellegonzalez5-Jan-17 5:54 
QuestionCreating DirectShow source filter Pin
ceatea17-Feb-16 10:59
Memberceatea17-Feb-16 10:59 
GeneralRe: Creating DirectShow source filter Pin
Richard MacCutchan18-Feb-16 0:56
mveRichard MacCutchan18-Feb-16 0:56 

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.