Answers for "Check the image type in c# asp.net mvc"

C#
0

c# display image

// open file dialog   
OpenFileDialog open = new OpenFileDialog();  
// image filters  
open.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp";  
if (open.ShowDialog() == DialogResult.OK) {  
    // display image in picture box  
    pictureBox1.Image = new Bitmap(open.FileName);  
    // image file path  
    textBox1.Text = open.FileName;  
}  
Posted by: Guest on June-02-2020
0

c# how to get src from html img

string str = "<div> <img src="https://i.testimg.com/images/g/test/s-l400.jpg" style="width: 100%;"> <div>Test</div> </div>";

// Get the index of where the value of src starts.
int start = str.IndexOf("<img src="") + 10;

// Get the substring that starts at start, and goes up to first ".
string src = str.Substring(start, str.IndexOf(""", start) - start);
Posted by: Guest on December-05-2020

Code answers related to "Check the image type in c# asp.net mvc"

C# Answers by Framework

Browse Popular Code Answers by Language