Friday, October 12, 2012
How to solve problem: Can't add a reference into console project
Change Target Framework from ".NET Framework 4 Client Profile" to ".NET Framework 4".
HTTP Made Really Easy
http://www.jmarshall.com/easy/http/#whatis
Using HTTP 1.0
What is HTTP?
What are "Resources"?
Structure of HTTP Transactions
Initial Request Line
Initial Response Line (Status Line)
Header Lines
The Message Body
Sample HTTP Exchange
Other HTTP Methods, Like HEAD and POST
The HEAD Method
The POST Method
HTTP Proxies
Being Tolerant of Others
Conclusion
Using HTTP 1.0
What is HTTP?
What are "Resources"?
Structure of HTTP Transactions
Initial Request Line
Initial Response Line (Status Line)
Header Lines
The Message Body
Sample HTTP Exchange
Other HTTP Methods, Like HEAD and POST
The HEAD Method
The POST Method
HTTP Proxies
Being Tolerant of Others
Conclusion
Transforming Data Source objects into XML using LINQ
http://www.itorian.com/2012/09/transforming-data-source-objects-into_7545.html
var studentsToXML = new XElement("School",
from student in students
let x = String.Format("{0},{1},{2},{3}", student.Marks[0], student.Marks[1], student.Marks[2], student.Marks[3])
select new XElement("Student",
new XElement("ID", student.ID),
new XElement("Name", student.Name),
new XElement("Address", student.Address),
new XElement("Marks", x)
) //end of "student"
); //end of "Root
var studentsToXML = new XElement("School",
from student in students
let x = String.Format("{0},{1},{2},{3}", student.Marks[0], student.Marks[1], student.Marks[2], student.Marks[3])
select new XElement("Student",
new XElement("ID", student.ID),
new XElement("Name", student.Name),
new XElement("Address", student.Address),
new XElement("Marks", x)
) //end of "student"
); //end of "Root
Thursday, October 11, 2012
How to solve problem, "The operation has timed out at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)"
Need to dispose HttpWebResponse
using (HttpWebResponse webresponse = (HttpWebResponse)webrequest.GetResponse())
{
using (var str = new StreamReader(webresponse.GetResponseStream()))
{
result = str.ReadToEnd();
}
webresponse.Close();
}
using (HttpWebResponse webresponse = (HttpWebResponse)webrequest.GetResponse())
{
using (var str = new StreamReader(webresponse.GetResponseStream()))
{
result = str.ReadToEnd();
}
webresponse.Close();
}
Subscribe to:
Posts (Atom)