Search Results

Search found 2 results on 1 pages for 'omegavirus'.

Page 1/1 | 1 

  • Codemetric optimized httpwebrequest in C#

    - by Omegavirus
    Hello, the problem is the httpwebrequest method in my c# program. visual studio gives it a metric of 60, thats pretty lame.. so how can i program it more efficient? (: my actual code: public string httpRequest(string url) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = "GET"; request.Proxy = WebRequest.DefaultWebProxy; request.MediaType = "HTTP/1.1"; request.ContentType = "text/xml"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12"; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader streamr = new StreamReader(response.GetResponseStream(), Encoding.UTF8); String sresp = streamr.ReadToEnd(); streamr.Close(); return sresp; } thanks for helping. ;)

    Read the article

  • C# http network requests with Windows service

    - by Omegavirus
    hello, today i wrote a windows service which needs to send regular http requests to a server. the problem is that the service runs under the "SYSTEM" account as local service and as such a type of service it isn't allowed to access the network.. for installing the service i use this class: http://dl.dropbox.com/u/152585/ServiceInstaller.cs is there a way to send http requests in a .net c# windows service and get the http response? thanks. :)

    Read the article

1