i have 5 codes line.. how can i go to 2 code line from 5 code line ??

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 +1

i 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
oguzkaygun
6/6/2008 11:12:22 AM
📁 asp.net.visual-basic.net
📃 3721 articles.
⭐ 0 followers.

💬 1 Replies
👁️‍🗨️ 298 Views

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.Click

c = 0

Dim xxx As Label

xxx:

 

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 String

filepath = 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 = "" Then

FileUpload1.PostedFile.SaveAs(Server.MapPath(DestinationPath))

Image1.ImageUrl = DestinationPath


Mark as me if my question or my answer can be helpful for you :)
0
oguzkaygun
6/6/2008 11:59:40 AM
Reply: