Search Results

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

Page 1/1 | 1 

  • REG GENERIC METHOD

    - by googler1
    Hi buddies, I had a thought on using the generic method in c# as like we do in c++. Normally a method looks like this: public static (void/int/string) methodname((datatype) partameter) { return ...; } I had a thought whether can we implement the generics to this method like this: public static <T> methodname(<T> partameter) { return ...; } Using as a generic to define the datatype. Can anyone pls suggest whether the above declaration is correct and can be used in c#? Thanks in advance.

    Read the article

  • HttpWebRequest timeout in Windows service

    - by googler1
    I am getting a timeout error while starting my Windows service. I am tring to download an XML file from a remote system which causes a timeout during the service OnStart. This is the method I am calling from OnStart: public static StreamReader GetResponseStream() { try { EventLog.WriteEntry("Epo-Service_Retriver", "Trying ...", EventLogEntryType.Information); CookieContainer CC = new CookieContainer(); HttpWebRequest request = (HttpWebRequest)WebRequest.Create( Utils.GetWeeklyPublishedURL()); request.Proxy = null; request.UseDefaultCredentials = true; request.KeepAlive = true; //THIS DOES THE TRICK request.ProtocolVersion = HttpVersion.Version10; // THIS DOES THE TRICK request.CookieContainer = CC; WebResponse response = request.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); EventLog.WriteEntry("Epo-Service_Retriver", "Connected to Internet...", EventLogEntryType.SuccessAudit); return reader; } } Is there any possibility to avoid this timeout?

    Read the article

1