EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Error on client.keystorage=keystorage

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#21104
Posted: 08/21/2012 12:04:06
by gwinetworks gwinetworks (Standard support level)
Joined: 12/27/2011
Posts: 3

Hello all,

I am wondering if someone might shed some light on this. It works fine in the vb.net sample simple ssh client, but in my asp.net app, I get this error.

at the point of

KeyStorage = New TElSSHMemoryKeyStorage
client.KeyStorage = New TElSSHMemoryKeyStorage

I get Object reference not set to an instance of an object.

My code to this point is the same as it is in the sample.

Running this on Windows 7 IIS7. I also noticed that the assemblies are not added to the GAC during installation of the secureblackbox package.
#21110
Posted: 08/21/2012 15:13:24
by gwinetworks gwinetworks (Standard support level)
Joined: 12/27/2011
Posts: 3

For some reason, when I run this in a class, it works, but when I build it into a DLL and add a reference to it, I get the error? Any thoughts? Code is exactly the same

Code
Imports System
Imports System.Net
Imports System.Net.Sockets
Imports SBUtils
Imports SBSharedResource
Imports SBSSHCommon
Imports SBSSHKeyStorage
Imports SBSSHConstants
Imports SBSSHClient
Imports SBSimpleSSH
Public Class Netconf
    Public WithEvents Client As New TElSimpleSSHClient
    Private Connected As Boolean
    Private ChangeComplete As Boolean = False
    Private KeyStorage As TElSSHMemoryKeyStorage
    Private recvBuffer(0) As Byte
    Private recvBufferIndex As Integer
    Private spoolBuffer(0) As Byte
    Private spoolBufferIndex As Integer
    Private lck As TElSharedResource

    Private Const sbbkey As String = "MYKEY"
    Private objErrorHandler As NCErrorHandler

    Private Sub Initialize()
        ReDim recvBuffer(65536)
        recvBufferIndex = 0
        ReDim spoolBuffer(65536)
        spoolBufferIndex = 0
        lck = New TElSharedResource
        SBUtils.Unit.SetLicenseKey(sbbkey)
        Connected = False

        KeyStorage = New TElSSHMemoryKeyStorage
        client.KeyStorage = KeyStorage <-- Error here

    End Sub


Do I need to declare it differently when in a .dll file?
#21144
Posted: 08/22/2012 14:20:54
by gwinetworks gwinetworks (Standard support level)
Joined: 12/27/2011
Posts: 3

Forgot to use the New when declaring the client. brain fart moment I guess

Reply

Statistics

Topic viewed 804 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!