Created
April 11, 2012 14:15
-
-
Save Opus1no2/2359566 to your computer and use it in GitHub Desktop.
Brief example of how to receive GET data using C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ 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