我已經開始一個新的應用程序,並且每30秒它會將圖片保存到臨時目錄,但我需要保存每個照片用不同的名稱,如MDAL1Image1.jpg,MDAL1Image2.jpg等,但我得到這個錯誤從字符串「C: Mediamemebuilderpro MDAL1Imag」轉換爲輸入'Double'無效。「
{"Conversion from string "C:\Mediamemebuilderpro\MDAL1Imag" to type 'Double' is not valid."}
這是我的錯誤
PB1.Save("C:\Mediamemebuilderpro\" + "MDAL1Image" + nametosave + ".jpg", System.Drawing.Imaging.ImageFormat.Bmp)
timetosavetemp = 0
這是代碼我得到錯誤的行
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
timetosavetemp = timetosavetemp + 1
If timetosavetemp >= 30 Then
Dim nametosave = 1
nametosave = nametosave + 1
Dim PB1 As New Bitmap(PictureBox1.Image)
PB1.Save("C:\Mediamemebuilderpro\" + "MDAL1Image" + nametosave + ".jpg", System.Drawing.Imaging.ImageFormat.Bmp)
timetosavetemp = 0
End If
End Sub
[在VB.NET中加入和加入字符串的區別](https://stackoverflow.com/questions/734600/the-difference-between-and-for-joining-strings-in- vb-net) –