Skip to content

Instantly share code, notes, and snippets.

@Opus1no2
Created April 11, 2012 14:15
Show Gist options
  • Save Opus1no2/2359566 to your computer and use it in GitHub Desktop.
Save Opus1no2/2359566 to your computer and use it in GitHub Desktop.
Brief example of how to receive GET data using C#
<%@ Page Language="C#" %>
<%
// Load NameValueCollection object.
NameValueCollection coll=Request.QueryString;
if (coll.Count > 0) {
// File where data will be written.
System.IO.StreamWriter file = new System.IO.StreamWriter("/path/to/test.txt");
foreach (String param in coll) {
file.WriteLine("Param: " + Server.HtmlEncode(param));
file.WriteLine("Value: " + Server.HtmlEncode(coll[param]) + "\r\n-----------");
}
file.Close();
}
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment