C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Running an Method From a External DLL in a webservice


Posted Date: 07 Sep 2008    Resource Type: Code Snippets    Category: Windows Services

Posted By: Initiotech       Member Level: Gold
Rating:     Points: 10



This Sample will demonstrate how to execute an method from an external dll in an webservice.

The sample is split into two parts one contains the Dll Codes and one contains the Service code.

The project that contains the Dll is named ServiceDll
The project that contains the Service is named ServiceApp

Code From ServiceDll.Class1

Public Sub Write(ByVal text As String)
Dim txt As New StreamWriter("C:\Dummy.txt")
txt.WriteLine(text)
txt.Close()
End Sub


Code from ServiceApp.Service1

Imports ServiceDLL
Public Class Service1
Dim cl As New Class1()

Protected Overrides Sub OnStart(ByVal args() As String)
cl.Write("Service Started At : " + DateAndTime.Now)
End Sub

Protected Overrides Sub OnStop()
cl.Write("Service Stoped At : " + DateAndTime.Now)
End Sub
End Class


refer to the attached example for details.

To install the Service just type
"installutil serviceapp.exe" in the Visual Studio Command prompt.


Regards Hefin Dsouza


Attachments

  • Webservice Demo (20743-7616-WindowsService.rar)



  • Responses


    No responses found. Be the first to respond and make money from revenue sharing program.

    Feedbacks      
    Popular Tags   What are tags ?   Search Tags  
    Web services  .  Vb.net  .  Service  .  Dot net  .  

    Post Feedback


    This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
    You must Sign In to post a response.
    Next Resource: Automatically Sending Email from Sql Table Through Windows Services
    Previous Resource: Sample for creating a windows service - Simple
    Return to Discussion Resource Index
    Post New Resource
    Category: Windows Services


    Post resources and earn money!
     
    Related Resources



    dotNet Slackers   BizTalk Adaptors    Web Design

    it help desk

    Contact Us    Privacy Policy    Terms Of Use