Solved

Can I call Server.UrlEncode from an executable?

Posted on 2007-12-04
2
680 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

705 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