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

  • Question

  • User-1418772296 posted

    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

    Friday, June 6, 2008 7:12 AM

Answers

  • User-1418772296 posted

    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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 6, 2008 7:59 AM