(09-11-20, 03:37 PM)العطر الرايق كتب : sql يكون افضل . لان حتى مشروعي الداتا المعموله به sql
الله الله
انا وش ملصقني بالاكسس؟!
الوضع مية مية.
المثال مرفق
PHP كود :
Imports System.Data.SqlClient
Public Class Form1
Dim ax, ay As Integer
Dim dr As Boolean
Dim fbd As FolderBrowserDialog
Dim con As New SqlConnection("Server=.\sqlexpress;Database=pics;Trusted_Connection=True;MultipleActiveResultSets=True")
Private Sub savepics(ByVal u As String)
Dim count As Integer = 0
Dim dir As New IO.DirectoryInfo(u)
count = dir.GetFiles("*.*").Count
Dim i As Integer = 0
p.Invoke(Sub() p.Maximum = count - 1)
If con.State = ConnectionState.Closed Then con.Open()
Dim cm As New SqlCommand("", con)
For Each fl As IO.FileInfo In dir.GetFiles("*.*")
Try
cm.Parameters.Clear()
cm.CommandText = "insert into tb(picname) values(@picname)"
cm.Parameters.AddWithValue("@picname", fl.Name)
cm.ExecuteNonQuery()
lblname.Invoke(Sub() lblname.Text = fl.Name)
p.Invoke(Sub() p.Value = i)
fl.CopyTo(CurDir() & "\pics\" & fl.Name)
i += 1
Threading.Thread.Sleep(500)
Catch ex As Exception
End Try
Next
If con.State = ConnectionState.Open Then con.Close()
End Sub
Private Sub Form1_MouseDown(sender As Object, e As MouseEventArgs) Handles MyBase.MouseDown, Label1.MouseDown, lblname.MouseDown
If e.Button = MouseButtons.Left Then
dr = True
ax = MousePosition.X - Me.Left
ay = MousePosition.Y - Me.Top
End If
End Sub
Private Sub Form1_MouseMove(sender As Object, e As MouseEventArgs) Handles Me.MouseMove, Label1.MouseMove, lblname.MouseMove
If dr Then
Me.Left = MousePosition.X - ax
Me.Top = MousePosition.Y - ay
End If
End Sub
Private Sub btnclose_Click(sender As Object, e As EventArgs) Handles btnclose.Click
Close()
End Sub
Private Sub btnmin_Click(sender As Object, e As EventArgs) Handles btnmin.Click
Me.WindowState = FormWindowState.Minimized
End Sub
Private Sub Form1_MouseUp(sender As Object, e As MouseEventArgs) Handles Me.MouseUp, Label1.MouseUp, lblname.MouseUp
dr = False
End Sub
Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
My.Settings.mloc = Me.Location
My.Settings.Save()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
fbd = New FolderBrowserDialog
If fbd.ShowDialog = DialogResult.OK Then
Dim th As New Threading.Thread(AddressOf savepics)
If th.IsAlive = False Then
th.Start(fbd.SelectedPath)
End If
End If
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
Me.Location = My.Settings.mloc
End Sub
End Class