Advertisement
Guest User

Untitled

a guest
Jun 29th, 2013
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. string foo = InkBunnyUrls.Login + "&username=" + txtUsername.Text + "&password=" + txtPassword.Password;
  2. //foo = https://inkbunny.net/api_login.php?output_mode=xml&username=test&password=foobar#1
  3. string url = System.Net.HttpUtility.HtmlEncode(foo);
  4. // url = https://inkbunny.net/api_login.php?output_mode=xml&username=test&password=foobar#1
  5.  
  6. string foo = InkBunnyUrls.Login + "&username=" + txtUsername.Text + "&password=" + txtPassword.Password;
  7. //foo = https://inkbunny.net/api_login.php?output_mode=xml&username=test&password=foobar#1
  8. string url = Uri.EscapeUriString(foo);
  9. // https://inkbunny.net/api_login.php?output_mode=xml&username=test&password=foobar#1
  10.  
  11. string encoded = HttpUtility.UrlEncode("#"); // "%23"
  12.  
  13. string encoded = Uri.EscapeDataString("#"); // "%23"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement