Click here to Skip to main content
15,886,258 members
Home / Discussions / C#
   

C#

 
QuestionGet Pressed key from KeyboardFocusChangedEventArgs Pin
pankajsood26-Mar-12 20:43
pankajsood26-Mar-12 20:43 
AnswerRe: Get Pressed key from KeyboardFocusChangedEventArgs Pin
Mycroft Holmes26-Mar-12 22:36
professionalMycroft Holmes26-Mar-12 22:36 
GeneralRe: Get Pressed key from KeyboardFocusChangedEventArgs Pin
Vipin_Arora26-Mar-12 23:22
Vipin_Arora26-Mar-12 23:22 
QuestionEscape Key not working on PropertyGrid's KeyDown and Preview Key Down Event Pin
pankajsood26-Mar-12 19:23
pankajsood26-Mar-12 19:23 
QuestionMaximum limits on DataSet Dimension Pin
MAW3026-Mar-12 15:03
MAW3026-Mar-12 15:03 
AnswerRe: Maximum limits on DataSet Dimension Pin
Mycroft Holmes26-Mar-12 17:28
professionalMycroft Holmes26-Mar-12 17:28 
GeneralRe: Maximum limits on DataSet Dimension Pin
MAW3026-Mar-12 18:29
MAW3026-Mar-12 18:29 
QuestionDownloading an image from web Pin
Muammar©26-Mar-12 14:09
Muammar©26-Mar-12 14:09 
Hi,
Can you kindly shed some light on what's wrong with the below code?
Many thanks,

C#
private Image DownloadImage(string _URL)
{
    try
    {
        WebClient client = new WebClient();
        Stream stream = client.OpenRead(_URL); //The problem seems to be here
        Image img = Image.FromStream(stream);
        stream.Flush();
        stream.Close();
        return img;
    }
    catch (Exception e)
    {
        MessageBox.Show(e.Message);
        return null;
    }

}

AnswerRe: Downloading an image from web Pin
Luc Pattyn26-Mar-12 14:28
sitebuilderLuc Pattyn26-Mar-12 14:28 
AnswerRe: Downloading an image from web Pin
Abhinav S26-Mar-12 15:35
Abhinav S26-Mar-12 15:35 
GeneralRe: Downloading an image from web Pin
Jack Li26-Mar-12 22:06
Jack Li26-Mar-12 22:06 
AnswerRe: Downloading an image from web Pin
kingNull26-Mar-12 23:30
kingNull26-Mar-12 23:30 
GeneralRe: Downloading an image from web Pin
Muammar©27-Mar-12 10:23
Muammar©27-Mar-12 10:23 
GeneralRe: Downloading an image from web Pin
Pete O'Hanlon27-Mar-12 10:40
mvePete O'Hanlon27-Mar-12 10:40 
AnswerRe: Downloading an image from web Pin
V.26-Mar-12 23:51
professionalV.26-Mar-12 23:51 
QuestionMessenger Class Problem Pin
Kevin Marois26-Mar-12 8:08
professionalKevin Marois26-Mar-12 8:08 
AnswerRe: Messenger Class Problem Pin
SledgeHammer0126-Mar-12 8:23
SledgeHammer0126-Mar-12 8:23 
GeneralRe: Messenger Class Problem Pin
Kevin Marois26-Mar-12 10:34
professionalKevin Marois26-Mar-12 10:34 
GeneralRe: Messenger Class Problem Pin
SledgeHammer0126-Mar-12 10:48
SledgeHammer0126-Mar-12 10:48 
GeneralRe: Messenger Class Problem Pin
Kevin Marois26-Mar-12 10:50
professionalKevin Marois26-Mar-12 10:50 
GeneralRe: Messenger Class Problem Pin
SledgeHammer0126-Mar-12 11:06
SledgeHammer0126-Mar-12 11:06 
AnswerRe: Messenger Class Problem Pin
BobJanova27-Mar-12 4:58
BobJanova27-Mar-12 4:58 
QuestionIdentify which Element fired event handler code-behind. Pin
cknight72526-Mar-12 6:28
cknight72526-Mar-12 6:28 
AnswerRe: Identify which Element fired event handler code-behind. PinPopular
Luc Pattyn26-Mar-12 6:40
sitebuilderLuc Pattyn26-Mar-12 6:40 
GeneralRe: Identify which Element fired event handler code-behind. Pin
cknight72527-Mar-12 7:23
cknight72527-Mar-12 7:23 

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.