Before Coding Code Table: WebAPI.dll (Visual Studio)

Public Class Form1
    Private _appFx As Blackbaud.AppFx.WebAPI.ServiceProxy.AppFxWebService
    Private _clientAppInfoHeader As Blackbaud.AppFx.WebAPI.ServiceProxy.ClientAppInfoHeader
    Private _myCred As System.Net.ICredentials

    Private Sub InitializeAppFxWebService()
        _myCred = GetNetworkCredentials()
        _appFx = New Blackbaud.AppFx.WebAPI.ServiceProxy.AppFxWebService
        _appFx.Credentials = _myCred
        _appFx.Url = "http://localhost/bbAppFx/appfxwebservice.asmx"
        _clientAppInfoHeader = New Blackbaud.AppFx.WebAPI.ServiceProxy.ClientAppInfoHeader()
        _clientAppInfoHeader.ClientAppName = "Blackbaud Enterprise CRM"
        _clientAppInfoHeader.REDatabaseToUse = "BBInfinity"
    End Sub

    Private Function GetNetworkCredentials() As System.Net.ICredentials
        Dim securelyStoredUserName, securelyStoredPassword As String
        securelyStoredUserName = ""
        securelyStoredPassword = ""
        '**** Providing Credentials
        'System.Net.NetworkCredential implements System.NET.ICredentials
        'Typically the developer does not need to provide the domain name. 
        Dim NetworkCredential As New System.Net.NetworkCredential(securelyStoredUserName, securelyStoredPassword)
        Return NetworkCredential
    End Function

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        InitializeAppFxWebService()
    End Sub
End Class