Step 1
(UPDATED!) SEP 2012
First create your form in Google doc.
Step 2
Open the form and check the source to find this line, and copy the Action
parameter value:
<form action=https://docs.google.com/formResponse?formkey=XXXXXXX&ifq
method="POST" id="ss-form">
Step 3
Use this method to submit a new entry in your C# code (this example is for a form with two textbox
es):
void SubmitGoogleDoc(){
WebClient wc = new WebClient();
var keyval = new NameValueCollection();
keyval.Add("entry.0.single", "XXXX");
keyval.Add("entry.1.single", "XXXX");
keyval.Add("submit", "Submit");
wc.UploadValuesCompleted +=
new UploadValuesCompletedEventHandler(wc_UploadValuesCompleted);
wc.Headers.Add("Origin", "https://docs.google.com");
wc.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10");
wc.UploadValuesAsync(new Uri
("https://docs.google.com/formResponse?formkey=XXXXX&ifq"),
"POST", keyval, Guid.NewGuid().ToString());
}
void wc_UploadValuesCompleted(object sender, UploadValuesCompletedEventArgs e)
{
}
Thanks.
Hope this small tip will make you happy.