Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
System.Web.HttpUtility + URLEncoded String
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 1.1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01016140
Message ID:
01016522
Views:
11
This message has been marked as the solution to the initial question of the thread.
You need to add System.Web to your assembly references of the project.

+++ Rick ---

>Rich I notice that HttpUtility should work after adding the System.Web namespace. I tried the sample in msdn and it did not work for me.
>this is my namespace
>
>using System;
>using System.Drawing;
>using System.Collections.Specialized;
>using System.ComponentModel;
>using System.Windows.Forms;
>using System.Data;
>using System.Net;
>using System.IO;
>using System.Text;
>using System.Web ;
>using sjSMSServiceManager.Class ;
>
>
>
>
>this is from MSDN sample. with error on compile
>
>D:\TEMP\ConsoleApplication3\Class1.cs(14): The type or namespace name 'HttpUtility' could not be found (are you missing a using directive or an assembly reference?)
>
>
>
>
>using System;
>using System.Web;
>using System.IO;
>
>   class MyNewClass
>   {
>      public static void Main()
>      {
>         String myString;
>         Console.WriteLine("Enter a string having '&' or '\"'  in it: ");
>         myString=Console.ReadLine();
>         String myEncodedString;
>         // Encode the string.
>         myEncodedString = HttpUtility.HtmlEncode(myString);
>         Console.WriteLine("HTML Encoded string is "+myEncodedString);
>         StringWriter myWriter = new StringWriter();
>         // Decode the encoded string.
>         HttpUtility.HtmlDecode(myEncodedString, myWriter);
>         Console.Write("Decoded string of the above encoded string is "+
>                        myWriter.ToString());
>      }
>   }
>
>
>Thanks rick
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform