The process cannot access the file 'D:\Picture\2015-03-10+13.57.41.jpg' because it is being used by another process.
อันนี้โค้ดครับ
Code (VB.NET)
With OpenFileDialog1
.CheckFileExists = True
.ShowReadOnly = False
.Filter = "All Files|*.*|Picture Files|*.bmp;*.gif;*.jpg;*.png"
.FilterIndex = 2
If .ShowDialog = Windows.Forms.DialogResult.OK Then
fs = New FileStream(.FileName.ToString(), FileMode.Open)
fsImage = New Byte(fs.Length) {}
fs.Read(fsImage, 0, fs.Length)
fs.Close()
bm = Image.FromFile(.FileName.ToString())
PictureBox1.Image = bm
txtimg.Text = System.IO.Path.GetFileName(.FileName)
End If
End With
Tag : .NET, Ms SQL Server 2005, VS 2005 (.NET 2.x)