Dear Team,
I am bigner in C# I want to retraiver image from diffrent server to my window form picture box. i having all detail of server plz help me how can i get it.
Dear Team,
I am bigner in C# I want to retraiver image from diffrent server to my window form picture box. i having all detail of server plz help me how can i get it.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jithu ThomasRank #437 · 5.7K reputationPosted Oct 14, 2023, 6:38 AM EDT
using System; using System.Drawing; using System.IO; using System.Net; using System.Windows.Forms; namespace ImageRetrievalApp { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void RetrieveImageButton_Click(object sender, EventArgs e) { string imageUrl = "http://example.com/path/to/your/image.jpg"; // Replace with the URL of the image on the remote server try { // Create a WebRequest to download the image WebRequest request = WebRequest.Create(imageUrl); using (WebResponse response = request.GetResponse()) using (Stream stream = response.GetResponseStream()) { // Load the image from the stream Image image = Image.FromStream(stream); // Display the image in the PictureBox pictureBox1.Image = image; } } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); } } } }Neeraj Choudhary52 reputationPosted Oct 14, 2023, 2:07 PM EDT
Where I need to use user name and password
And how to know what is server url
I know path of image but not aware server url
Jithu ThomasRank #437 · 5.7K reputationPosted Oct 15, 2023, 2:54 AM EDT
Dear,
is it comming from a database or a hosting server url.
Regards,
Neeraj Choudhary52 reputationPosted Oct 15, 2023, 10:44 PM EDT
Hosting server. I aware user name and password but don't know the server url plz suggest how to retrieve
Neeraj Choudhary52 reputationPosted Oct 23, 2023, 12:51 PM EDT
Not able to retrieve