Solved

Can I call Server.UrlEncode from an executable?

Posted on 2007-12-04
2
678 Views
Last Modified: 2012-06-27
I am writing an executable in C# that will send emails with links to my website.  In this executable I want to format the URLs and part of that is to encode the URL parameters.  However, I find that the Server.UrlEncode method is part of System.Web.HttpServerUtility and thus cannot be called from my executable.  It seems like there is no reason that UrlEncode is part of this library... is there a way I can call this method or an equivalent one in my executable?  Or will I have to disassemble the C# and copy out the implementation to my own methods?

Thanks for your help!
0
Comment
Question by:maltomeal8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
Daniel Reynolds earned 125 total points
ID: 20406254
You can reference System.Web assembly in your Windows Forms project and call
the static method HttpUtility.UrlEncode() .
Calling this method doesn't require being run as a web page, you can call it
from a windows forms, console or service application.

see this link:
http://www.thescripts.com/forum/thread233425.html
0
 

Author Closing Comment

by:maltomeal8
ID: 31412673
That's exactly what I was looking for!  Thanks for your speedy reply!
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question