Hi All,
I made a program to capture photo,make a file name to it base on the serial number of the items and save in a specified or selected path in my computer, I want to upgrade my program, so that when Users capture same items with same serial number it will alert and tell Users that this serial number is already captured,means already have copy in the path in my computer. so that user will not continue.
here is my code please help me modify it to avoid duplicate data in my specified path.
thanks in advanced.
how can i check if the file name is already in the path i specified,Code:'select path where to save the photo using folderbrowsedialog1 Private Sub btnSelectPath_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelectPath.Click If FolderBrowserDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then txtPath.Text = FolderBrowserDialog1.SelectedPath End If End Sub 'when i click this button it will save the photo in a specified path with a fileName of serial number. Private Sub btnTop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTop.Click Dim strFileName As String strFileName = txtSerialNo.Text & Format(Now, " -T") & ".jpg" If txtSerialNo.Text <> "" Then PictureBox1.Image.Save(txtPath.Text & "\" & strFileName, System.Drawing.Imaging.ImageFormat.Jpeg) Else MsgBox("Scan Sn", MsgBoxStyle.Critical, "Error") txtSerialNo.Focus() End If
thank you.




Reply With Quote
