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:
01016411
Views:
8
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
Roses are #FF0000 Violets are #0000FF all my base are belong to you
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform