You are here: MessengerYouLike.IMSDK.IMServer > Using IMSDK.IMServer Within Visual Studio .NET > Adding IMSDK.IMServer As A Reference Within Visual Studio .NET 2005
MessengerYouLike.IMSDK.IMServer
Adding IMSDK.IMServer As A Reference Within Visual Studio .NET 2005

When using Visual Studio .NET 2005, IMSDK.IMServer can be added as a reference.

When using Visual Studio .NET 2005, IMSDK.IMServer can be added as a reference. 

 

The following steps illustrate how to add IMSDK.IMServer as a reference within Visual Studio .NET 2005 

 

To add IMSDK.IMServer as a reference within Visual Studio .NET 2005

 

  1. Create a website as described in Create a Website

 

  1. Add IMSDK.IMServer as a reference. To do this right-click the References folder in the Solution Explorer and choose Add Reference (see the screen shot below). If the Solution Explorer is not visible, navigate to the View menu and choose Solution Explorer.

 

 

  1. IMServer is a Must Inherit Class so it Must be inherited, so Create a Empty Class with any name we will use ClsIMServer in this example and inherits this Class from IMServer, Functions IMSDK.IMServer.NewUserRegistration and IMSDK.IMServer.VerifyLogin Must be implemented when IMSDK.IMServer.Integrated is set to true

 

'[Visual Basic]

'This class must Inherit IMServer
Public Class ClsIMServer
    Inherits MessengerYouLike.IMSDK.IMServer


    'This Function must be implemented when Integrated is set to true
    Public Overrides Function NewUserRegistration(ByVal Username As String, ByVal Password As String, ByVal Email As String, ByVal Firstname As String, ByVal Lastname As String) As Boolean

    End Function


    'This Functon must be implmented when Integrated is set to true
    Public Overrides Function VerifyLogin(ByVal Username As String, ByVal password As String) As Integer

    End Function
End Class

 

 

 

  1. Now Create a ASPX Page with any name we will use IMServer.aspx in this example, then add ClsIMServer to this class like

 

'[Visual Basic]
Partial Class IMServer
    Inherits System.Web.UI.Page
    Dim WithEvents IMS As New ClsIMServer


End Class

 

 

 

  1. Now Set the properties if IMServer on Form Load event Handler

 

Partial Class IMServer
    Inherits System.Web.UI.Page
    Dim WithEvents IMS As New ClsIMServer

    Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load

        'Secret Key to Encrypt and Decrypt all textual messages
        'This should be same in IMClient , if different no communication will take place
        IMS.SecretKey = "ABC1234"

        'Type of database MSSQL or MSACCESS
        'MSSQL is recommended
        IMS.DatabaseType = MessengerYouLike.IMSDK.IMServer.DatabaseProviders.MSSQL

        'Connection String for the above selected database
        IMS.ConnectionString = "server=ServerName;database=MessengerYouLike;uid=sa;pwd=sa"

        'Integrated into any other existing system?
        'Default is set to false
        IMS.Integrated = False

    End Sub



End Class

 

 

 

  1. Now after setting properties call the method IMSDK.IMServer.PassData and pass the request.form in parameter like

 

Partial Class IMServer
    Inherits System.Web.UI.Page
    Dim WithEvents IMS As New ClsIMServer

    Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load

        'Secret Key to Encrypt and Decrypt all textual messages
        'This should be same in IMClient , if differnet no communication will take place
        IMS.SecretKey = "ABC1234"

        'Type of database MSSQL or MSACCESS
        'MSSQL is recommended
        IMS.DatabaseType = MessengerYouLike.IMSDK.IMServer.DatabaseProviders.MSSQL
        'Connection String for the above selected database
        IMS.ConnectionString = "server=WAQAR;database=MessengerYouLike;uid=sa;pwd=sa"

        'Integrated into any other existing system?
        'Default is set to false
        IMS.Integrated = False


        'check for empty post
        If Request.Form.ToString <> "" Then

            'Always call this sub on each page load
            'This sub will parse all data
            IMS.PassData(Request.Form.ToString)

        End If


    End Sub

End Class
Copyright (c) 2007. All rights reserved.