Results 1 to 5 of 5

Thread: Calling a class constructor from outside the application

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Calling a class constructor from outside the application

    I have an ASP.NET (VB.NET) application, which has a class called clsSendEmail within it. I use this class from within the application to send a test email. What I want to do is create a console application, which will run completely independent of the web application, but is able to call the SendEmail class that is located within the Web app. How can I call the constructor of the SendMail class from outside the ASP.NET Application???

    Example
    VB Code:
    1. 'My ASP.NET Application
    2. Public Class clsSendMail
    3.     Public Sub New(ByVal strServerName As String, ByVal strDBName As String)
    4.         'Create a new instance of teh SendMail Class
    5.         Dim Mail As New SendMail(strServerName, strDBName)
    6.     End Sub
    7.  
    8.     Private Class SendMail()
    9.         'misc variable declarations
    10.  
    11.         Public Sub New(ByVal strServerName As String, ByVal strDBName As String, Optional ByVal blnTestEmail As Boolean = False, Optional ByVal strMailingID As String = "")
    12.  
    13.             'Do my email processing here, based on the parameters passed.
    14.         End Sub
    15.     End Class    
    16. End Class

    Here would be my console application that would be able to call the clsSendMail constructor
    VB Code:
    1. Public Class ConsoleSendMail
    2.    'What needs to be in this class to be able to call the
    3.    'clsSendMail class in the ASP.NET Application???
    4. End Class
    Last edited by Memnoch1207; Jan 1st, 2004 at 01:01 PM.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width