Solved

Can I call Server.UrlEncode from an executable?

Posted on 2007-12-04
2
667 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
2 Comments
 
LVL 17

Accepted Solution

by:
xDJR1875 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now