Search This Blog

Tuesday, September 13, 2011

HttpWebRequest in .net

HttpWebRequiest  request and responce from the server.


Uri objUri = new Uri(//Your Address from where u want httpresponce);

            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(objUri);

            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            Stream resStream = response.GetResponseStream();

            StreamReader reader = new StreamReader(resStream);

            string resData = reader.ReadToEnd();//here u will get the response in the form of string

Property in .net

For create property in .net is very easy.
just get and set it Foe Example u want to create property for Name then

just

public string Name
{
get;set;
}

here public is access specifier string return type,Name Property Name