Click to See Complete Forum and Search --> : Object reference not set to an instance of an object


infected
November 10th, 2005, 05:49 PM
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button submit;
protected System.Web.UI.WebControls.TextBox password;
protected System.Web.UI.WebControls.Label Output;
protected System.Web.UI.WebControls.TextBox clientID;

private Cryptography crypto;

private void Page_Load(object sender, System.EventArgs e)
{
if (Page.IsPostBack)
{

crypto = new Cryptography();
// Output.Text = crypto.Decrypt("89W8Z2RgNQnf1DEZd9wWNw==");

}
}



Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
CryptoSoft.Cryptography..ctor() +279
ClientLogin.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\clientlogin\clientlogin.aspx.cs:40
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

i am a newbee, i have no idea how to solve this. any adivce is appreciated.

HanneSThEGreaT
November 11th, 2005, 05:36 AM
Hello! :wave:

Can you perhaps send the complete source code ¿

infected
November 11th, 2005, 09:20 AM
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using CryptoSoft;

namespace ClientLogin
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>


public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button submit;
protected System.Web.UI.WebControls.TextBox password;
protected System.Web.UI.WebControls.Label Output;
protected System.Web.UI.WebControls.TextBox clientID;

private Cryptography crypto;

private void Page_Load(object sender, System.EventArgs e)
{
if (Page.IsPostBack)
{

//Output.Text = Decrypt("89W8Z2RgNQnf1DEZd9wWNw==");



// try
// {
crypto = new Cryptography();
// Output.Text = crypto.Decrypt("89W8Z2RgNQnf1DEZd9wWNw==");
/* }
catch (NullReferenceException nre)
{
Output.Text = nre.Message;
}
*/

}
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion
}
}

Basically there is a dll CryptoSoft.Cryptography which i need to use to decrypt the password, I don't have the source code to that dll.

cmiskow
November 11th, 2005, 11:19 AM
Sounds like there's a null object reference inside the Cryptography constructor. I would contact the people that produced it.

infected
November 11th, 2005, 01:43 PM
Sounds like there's a null object reference inside the Cryptography constructor. I would contact the people that produced it.
would it help if i post the dll here? i mean not the actual source code but the dll?

cmiskow
November 11th, 2005, 02:29 PM
Not unless the dll developers happen to read this forum. Sorry :(