Click here to Skip to main content
15,895,557 members
Home / Discussions / C#
   

C#

 
AnswerRe: Diagnostics.Debug not working :-( Pin
Pouriya Ghamary17-Jun-11 21:28
Pouriya Ghamary17-Jun-11 21:28 
QuestionRetrieving of the database by selecting the computer Name Pin
anithagaraga22-Oct-08 18:33
anithagaraga22-Oct-08 18:33 
AnswerRe: Retrieving of the database by selecting the computer Name Pin
Abhijit Jana22-Oct-08 18:53
professionalAbhijit Jana22-Oct-08 18:53 
GeneralRe: Retrieving of the database by selecting the computer Name Pin
anithagaraga22-Oct-08 20:16
anithagaraga22-Oct-08 20:16 
Questionvertical scroll in listview Pin
samulong22-Oct-08 18:04
samulong22-Oct-08 18:04 
AnswerRe: vertical scroll in listview Pin
AhsanS22-Oct-08 20:18
AhsanS22-Oct-08 20:18 
QuestionHTml Encoding [modified] Pin
Fayu22-Oct-08 13:00
Fayu22-Oct-08 13:00 
AnswerRe: HTml Encoding Pin
Anthony Mushrow22-Oct-08 13:22
professionalAnthony Mushrow22-Oct-08 13:22 
What you're trying to do is get the ascii values of your string. It's not actually HTML which is why the functions aren't doing what you expected.

What you need is something like this, where you go through each character in your string and get the ascii value. Oh and you need it in hexadecimal rather than decimal:

string Encode(string input)
{
  StringBuilder sr = new StringBuilder();
  //go through each letter in your string
  foreach(char character in input)
  {
    int value = (int)character;
    sr.Append('%');
    //ToString("X") formats a decimal as hexadecimal
    sr.Append(value.ToString("X"));
  }  
  return sr.ToString();
}


EDIT: Woah, missed the pre tags there.

My current favourite word is: Nipple!
-SK Genius

Game Programming articles start -here[^]-

GeneralRe: HTml Encoding Pin
Fayu22-Oct-08 13:23
Fayu22-Oct-08 13:23 
JokeRe: HTml Encoding Pin
Anthony Mushrow22-Oct-08 13:28
professionalAnthony Mushrow22-Oct-08 13:28 
AnswerFigured it out Pin
Fayu22-Oct-08 13:22
Fayu22-Oct-08 13:22 
GeneralRe: Figured it out [modified] Pin
Guffa22-Oct-08 14:57
Guffa22-Oct-08 14:57 
GeneralRe: Figured it out Pin
Fayu24-Oct-08 18:46
Fayu24-Oct-08 18:46 
Questionmonitor and control screen from anothe machine Pin
Mohammed Elkholy22-Oct-08 11:15
Mohammed Elkholy22-Oct-08 11:15 
AnswerRe: monitor and control screen from anothe machine Pin
Abhijit Jana22-Oct-08 18:10
professionalAbhijit Jana22-Oct-08 18:10 
GeneralRe: monitor and control screen from anothe machine Pin
Mohammed Elkholy23-Oct-08 6:39
Mohammed Elkholy23-Oct-08 6:39 
Questionaccessing to slack space in doc. file Pin
Miss_hacker22-Oct-08 10:41
Miss_hacker22-Oct-08 10:41 
QuestionHiding resize arrows on windows form Pin
Zeddan22-Oct-08 8:17
Zeddan22-Oct-08 8:17 
AnswerRe: Hiding resize arrows on windows form Pin
Wendelius22-Oct-08 8:52
mentorWendelius22-Oct-08 8:52 
GeneralRe: Hiding resize arrows on windows form Pin
DaveyM6922-Oct-08 9:02
professionalDaveyM6922-Oct-08 9:02 
JokeRe: Hiding resize arrows on windows form Pin
Wendelius22-Oct-08 9:08
mentorWendelius22-Oct-08 9:08 
GeneralRe: Hiding resize arrows on windows form Pin
Zeddan22-Oct-08 9:05
Zeddan22-Oct-08 9:05 
GeneralRe: Hiding resize arrows on windows form Pin
Wendelius22-Oct-08 9:12
mentorWendelius22-Oct-08 9:12 
AnswerRe: Hiding resize arrows on windows form Pin
DaveyM6922-Oct-08 8:52
professionalDaveyM6922-Oct-08 8:52 
QuestionHow to display dynamic drop downlists in a string. Pin
pnagubandi22-Oct-08 8:07
pnagubandi22-Oct-08 8:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.