Click here to Skip to main content
15,900,110 members
Home / Discussions / C#
   

C#

 
GeneralRe: How To Merge Columns in DataGridView ..? Pin
Expert Coming16-Jun-07 0:46
Expert Coming16-Jun-07 0:46 
QuestionAssign Value in DropDownList type Combo Box Pin
Pankaj - Joshi15-Jun-07 22:25
Pankaj - Joshi15-Jun-07 22:25 
AnswerRe: Assign Value in DropDownList type Combo Box Pin
Luc Pattyn15-Jun-07 22:50
sitebuilderLuc Pattyn15-Jun-07 22:50 
GeneralRe: Assign Value in DropDownList type Combo Box Pin
Pankaj - Joshi15-Jun-07 23:47
Pankaj - Joshi15-Jun-07 23:47 
QuestionHow we get User active status in Activ directory Pin
ASysSolvers15-Jun-07 22:18
ASysSolvers15-Jun-07 22:18 
QuestionHow to bring whole word to next line Pin
Hum Dum15-Jun-07 22:07
Hum Dum15-Jun-07 22:07 
AnswerRe: How to bring whole word to next line Pin
Vasudevan Deepak Kumar16-Jun-07 1:57
Vasudevan Deepak Kumar16-Jun-07 1:57 
AnswerRe: How to bring whole word to next line Pin
Hesham Yassin20-Jun-07 0:26
Hesham Yassin20-Jun-07 0:26 
QuestionGetting unhandled exception in runtime Pin
beatles169215-Jun-07 21:24
beatles169215-Jun-07 21:24 
AnswerRe: Getting unhandled exception in runtime Pin
Christian Graus15-Jun-07 22:01
protectorChristian Graus15-Jun-07 22:01 
GeneralRe: Getting unhandled exception in runtime Pin
beatles169215-Jun-07 22:22
beatles169215-Jun-07 22:22 
GeneralRe: Getting unhandled exception in runtime Pin
Colin Angus Mackay16-Jun-07 0:41
Colin Angus Mackay16-Jun-07 0:41 
GeneralRe: Getting unhandled exception in runtime Pin
beatles169216-Jun-07 0:59
beatles169216-Jun-07 0:59 
QuestionImagebutton click+datalist+c# Pin
razanabanu15-Jun-07 20:53
razanabanu15-Jun-07 20:53 
AnswerRe: Imagebutton click+datalist+c# Pin
Christian Graus15-Jun-07 21:14
protectorChristian Graus15-Jun-07 21:14 
QuestionProblem with quicktime component (System.AccessViolationException) Pin
combo_ci15-Jun-07 20:48
combo_ci15-Jun-07 20:48 
AnswerRe: Problem with quicktime component (System.AccessViolationException) Pin
combo_ci15-Jun-07 23:25
combo_ci15-Jun-07 23:25 
QuestionTimeSpan Pin
Ian Uy15-Jun-07 19:13
Ian Uy15-Jun-07 19:13 
AnswerRe: TimeSpan Pin
Ravi Bhavnani15-Jun-07 19:26
professionalRavi Bhavnani15-Jun-07 19:26 
AnswerRe: TimeSpan Pin
PIEBALDconsult15-Jun-07 19:36
mvePIEBALDconsult15-Jun-07 19:36 
GeneralRe: TimeSpan Pin
Ian Uy15-Jun-07 19:42
Ian Uy15-Jun-07 19:42 
GeneralRe: TimeSpan Pin
Luc Pattyn15-Jun-07 21:02
sitebuilderLuc Pattyn15-Jun-07 21:02 
QuestionA question about Add-in Pin
imagic15-Jun-07 18:57
imagic15-Jun-07 18:57 
QuestionStreamReader problem Pin
gvanto15-Jun-07 17:26
gvanto15-Jun-07 17:26 
I have a problem when reading a Streamreader object into a string:

<br />
private string GetStringFromURL(string url)<br />
        {<br />
            string strOut = "";<br />
<br />
            // Attempt download from internet:<br />
            HttpWebRequest webRequest;<br />
            HttpWebResponse webResponse;<br />
            Stream responseStream;<br />
            //try<br />
            //{<br />
            webRequest = (HttpWebRequest)WebRequest.Create(url); //creating a web request object<br />
            webResponse = (HttpWebResponse)webRequest.GetResponse(); // creat a webResponse object so we can get the responces from server when we hs used the web request <br />
            responseStream = webResponse.GetResponseStream(); // creating a response stream object for the webResponse we have just created so we can use to get info into a StreamReader later<br />
            string responseEncoding = webResponse.ContentEncoding.Trim();<br />
            if (responseEncoding.Length == 0) responseEncoding = "us-ascii";<br />
            //loading the html page into a streamReader <br />
            StreamReader sr = new StreamReader(responseStream, System.Text.Encoding.GetEncoding(responseEncoding));<br />
<br />
            sr.BaseStream.ReadTimeout = 3000;  // 3 seconds<br />
            try<br />
            {<br />
                strOut = sr.ReadToEnd();<br />
            }<br />
            catch (WebException ioe)<br />
            {<br />
                MessageBox.Show(ioe.Message.ToString());<br />
            }<br />
<br />
<br />
            //while ((line = sr.ReadLine()) != null)<br />
            //{<br />
            //    strOut += line;<br />
            //}<br />
            webResponse.Close();<br />
            responseStream.Close();<br />
            sr.Close();<br />
            //}<br />
            //catch(WebException e)<br />
            //{<br />
            //    MessageBox.Show(e.Message);<br />
            //    // do nothing<br />
<br />
            //}<br />
<br />
            return strOut;<br />
<br />
            //string filePath = Application.StartupPath.ToString() + @"\" + "fileProxyRead.txt";<br />
            //return GetStringFromFile(filePath);<br />
        }<br />
<br />


The above code doesn't cause the Messagebox to actually pop up. When I pause the code I find it spends alot of it's time in the catch() area though. On closer inspection of the 'sr' object, it seems to have a problem:
<br />
BaseStream = Cannot evaluate expression because a native frame is on top of the call stack.<br />


Is there a way of checking for this error with an 'if' statement so that this process doesn't take so long? (it does eventually time out but this is v. slow. The url I'm reading into the string is:
http://www.atomintersoft.com/products/alive-proxy/proxy-list/?p=4[^]

Any help or advice much appreciated!!
Gerry



Put A Smile On Your Face
http://www.thecrazywebsite.com

AnswerRe: StreamReader problem Pin
Guffa16-Jun-07 0:00
Guffa16-Jun-07 0:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.