Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server.URLEncode from a Win32 app

Status
Not open for further replies.

pfontyn

Programmer
Mar 5, 2001
7
0
0
CA
I have a Win32 app that needs to gain access to the HttpServerUtility Server.URLEncode and Server.URLDecode methods.

Basically, what I need to do is something along these lines.
Code:
public string EncryptString(string val)
{	
    Page objPage = new Page();
    string strReturn = "";
    strReturn = mobjBlowfishSimple.Encrypt(val);
    return objPage.Server.UrlEncode(strReturn);		
}

Even with the appropriate using statements I cannot create an instance of the Page object. I understand that the Page object represents a .aspx page residing on a web server, but basically all I want is access to the methods.

Has anyone ever run across this or have a solution?

Thanks
 
I haven't tried this... and it may be way off ...pass the page object as one of the parameters to the method....




public string EncryptString(string val, HttpServerUtility server)
{
string strReturn = "";
strReturn = mobjBlowfishSimple.Encrypt(val);
return server.UrlEncode(strReturn);
}


when you call it call it passing
returnstring=EncryptString ("djfasl",Page.Server);


let me know if this works??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top