hello friends
i use visual basic for visual web developer
and i have below code.. i have 5 codes line.. how can i go to 2 code line from 5 code line ??
c = 0
second line
If System.IO.File.Exists("~\resimler\") = True Then c = c +1i want to go to 2 code line from here End If Dim DestinationPath As String = "~\resimler\" & c.ToString & FileUpload1.FileName
Mark as me if my question or my answer can be helpful for you :)
![]() |
0 |
![]() |
hello friends
i have solved this problem.. my code is below but i have new problem.. error codel line is FileUpload1.PostedFile.SaveAs(Server.MapPath(DestinationPath)) error message is your part of path was not found... anybody have a idea for this ??
cheers
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Clickc = 0
Dim xxx As Labelxxx:
Dim DestinationPath As String = "~\resimler\" & c.ToString & FileUpload1.FileName If System.IO.File.Exists(DestinationPath) = True Then
c = c + 1
GoTo xxx End If If FileUpload1.FileName <> "" Then Dim filepath As Stringfilepath = DestinationPath
Dim ext As String = Path.GetExtension(filepath) If ext.ToLower() = ".jpg" Or ext.ToLower() = ".jpeg" Or ext.ToLower() = ".bmp" Or ext.ToLower() = ".png" Or ext.ToLower() = ".tif" Or ext.ToLower() = ".gif" Then If Image1.ImageUrl = "" ThenFileUpload1.PostedFile.SaveAs(Server.MapPath(DestinationPath))
Image1.ImageUrl = DestinationPath
Mark as me if my question or my answer can be helpful for you :)
![]() |
0 |
![]() |