K
KhaLeeL ZoURoB
Guest
I have About 3,000 Folder in HD
And I have Table like this
ID int Auto Increment
FolderName nvarchar(250),
FileName nvarchar(250),
FileType nvarchar(5)
Requirement:
I Wan't To Insert the Folder and Contains File In Above Table
Dim di As New IO.DirectoryInfo("C:\pic\" & record("CI_ID_NUM"))
'affairID = record("ID")
Dim aryFi As IO.FileInfo() = di.GetFiles("*.*")
Dim fi As IO.FileInfo
Dim str As String
For Each fi In aryFi
str = fi.FullName.ToString
SelectedCardID = record("CI_ID_NUM")
Dim img As System.Drawing.Image = System.Drawing.Image.FromFile(str)
Dim imgBytes As Byte() = System.IO.File.ReadAllBytes(str)
'Resize Image
Dim w As Integer = 800
Dim h As Integer = w * img.Height / img.Width
Dim bmw As System.Drawing.Bitmap = New Bitmap(img, w, h)
Dim ms As System.IO.MemoryStream = New System.IO.MemoryStream()
bmw.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
imgBytes = MS.ToArray()
'End Resize
CivilRegDataAccess.SavePS_PICTURE_TB(SelectedCardID, imgBytes, txtDataSource.Text)
' Next
' End If
Next
Continue reading...
And I have Table like this
ID int Auto Increment
FolderName nvarchar(250),
FileName nvarchar(250),
FileType nvarchar(5)
Requirement:
I Wan't To Insert the Folder and Contains File In Above Table
Dim di As New IO.DirectoryInfo("C:\pic\" & record("CI_ID_NUM"))
'affairID = record("ID")
Dim aryFi As IO.FileInfo() = di.GetFiles("*.*")
Dim fi As IO.FileInfo
Dim str As String
For Each fi In aryFi
str = fi.FullName.ToString
SelectedCardID = record("CI_ID_NUM")
Dim img As System.Drawing.Image = System.Drawing.Image.FromFile(str)
Dim imgBytes As Byte() = System.IO.File.ReadAllBytes(str)
'Resize Image
Dim w As Integer = 800
Dim h As Integer = w * img.Height / img.Width
Dim bmw As System.Drawing.Bitmap = New Bitmap(img, w, h)
Dim ms As System.IO.MemoryStream = New System.IO.MemoryStream()
bmw.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
imgBytes = MS.ToArray()
'End Resize
CivilRegDataAccess.SavePS_PICTURE_TB(SelectedCardID, imgBytes, txtDataSource.Text)
' Next
' End If
Next
Continue reading...