Click here to Skip to main content
15,907,497 members
Home / Discussions / C#
   

C#

 
GeneralRe: Dll Import Problem in loading two c++ assemblies with same name Pin
Guffa14-Sep-06 19:15
Guffa14-Sep-06 19:15 
GeneralRe: Dll Import Problem in loading two c++ assemblies with same name Pin
He is Cool14-Sep-06 19:50
He is Cool14-Sep-06 19:50 
QuestionWin32 Functions InteropServices problems Pin
erikkl200014-Sep-06 17:28
erikkl200014-Sep-06 17:28 
Questionlooking for tab control like office 2003 shared workspace's style? Pin
jacktom14-Sep-06 17:09
jacktom14-Sep-06 17:09 
QuestionHow to develop an ie extension similar as google notebook? Pin
rryyjw14-Sep-06 16:09
rryyjw14-Sep-06 16:09 
QuestionHow to grab a web page using .Net 2.0 WebBrowser Control Pin
rryyjw14-Sep-06 16:06
rryyjw14-Sep-06 16:06 
AnswerRe: How to grab a web page using .Net 2.0 WebBrowser Control Pin
Nader Elshehabi14-Sep-06 16:32
Nader Elshehabi14-Sep-06 16:32 
AnswerRe: How to grab a web page using .Net 2.0 WebBrowser Control Pin
scott_hackett18-Sep-06 20:47
scott_hackett18-Sep-06 20:47 
You don't need the web browser to do that. Just do the following:

public string GetWebPage(string url)
{
    HttpWebRequest webRequest = null;
    HttpWebResponse webResponse = null;
    Stream responseStream = null;
    Encoding encode = null;
    StreamReader webPageStream = null;
    string webPageText = "";

    try
    {
        // Create the web request
        webRequest = (HttpWebRequest)HttpWebRequest.Create(url);
        // Get the response
        webResponse = (HttpWebResponse)webRequest.GetResponse();
        // Get the response stream
        responseStream = webResponse.GetResponseStream();
        // Get the encoding
        encode = Encoding.GetEncoding("utf-8");
        // Read the response and using a StreamReader
        webPageStream = new StreamReader(responseStream, encode);
        webPageText = webPageStream.ReadToEnd();
    }
    catch (Exception e)
    {
        MessageBox.Show("Error : " + e.Message);
    }
    finally
    {
        // free any resources
        if (webPageStream != null)
        {
            webPageStream.Close();
            webPageStream.Dispose();
        }
        if (responseStream != null)
        {
            responseStream.Close();
            responseStream.Dispose();
        }
        if (webResponse != null)
        {
            webResponse.Close();
        }
    }

    // return the page contents
    return webPageText;
}

QuestionAnother managed/unmanaged problem Pin
Kasic Slobodan14-Sep-06 15:32
Kasic Slobodan14-Sep-06 15:32 
AnswerRe: Another managed/unmanaged problem Pin
Nader Elshehabi14-Sep-06 15:58
Nader Elshehabi14-Sep-06 15:58 
GeneralRe: Another managed/unmanaged problem Pin
Kasic Slobodan15-Sep-06 1:59
Kasic Slobodan15-Sep-06 1:59 
QuestionRe: Another managed/unmanaged problem Pin
Kasic Slobodan15-Sep-06 7:53
Kasic Slobodan15-Sep-06 7:53 
AnswerRe: Another managed/unmanaged problem Pin
Nader Elshehabi15-Sep-06 12:38
Nader Elshehabi15-Sep-06 12:38 
GeneralRe: Another managed/unmanaged problem Pin
Kasic Slobodan16-Sep-06 1:29
Kasic Slobodan16-Sep-06 1:29 
GeneralRe: Another managed/unmanaged problem Pin
Nader Elshehabi16-Sep-06 1:44
Nader Elshehabi16-Sep-06 1:44 
GeneralRe: Another managed/unmanaged problem [modified] Pin
Kasic Slobodan17-Sep-06 1:12
Kasic Slobodan17-Sep-06 1:12 
QuestionHow can I download video files programmatically in C# [modified] Pin
desamsetty14-Sep-06 13:18
desamsetty14-Sep-06 13:18 
AnswerRe: How can I download video files programmatically in C# Pin
Dominic Pettifer14-Sep-06 13:35
Dominic Pettifer14-Sep-06 13:35 
AnswerRe: How can I download video files programmatically in C# Pin
scott_hackett18-Sep-06 21:22
scott_hackett18-Sep-06 21:22 
QuestionMemory Leak in C#.NET 2005 Pin
clint198214-Sep-06 10:31
clint198214-Sep-06 10:31 
AnswerRe: Memory Leak in C#.NET 2005 Pin
Christian Graus14-Sep-06 13:49
protectorChristian Graus14-Sep-06 13:49 
GeneralRe: Memory Leak in C#.NET 2005 Pin
clint198215-Sep-06 22:19
clint198215-Sep-06 22:19 
AnswerRe: Memory Leak in C#.NET 2005 Pin
Hamid_RT15-Sep-06 6:41
Hamid_RT15-Sep-06 6:41 
QuestionReturning Key-Value Pairs from Web Service Pin
DISP-Jol14-Sep-06 10:25
DISP-Jol14-Sep-06 10:25 
QuestionPulling values from xml nodes where xml is in string form Pin
Omkar Ghaisas14-Sep-06 9:04
Omkar Ghaisas14-Sep-06 9:04 

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.