none
How to convert this vb.net code to asp.net vb code? RRS feed

  • Question

  • hi all

    I am new to the asp.net  vb and I want to start by converting this code to asp.net vb code

     Dim ofd As New OpenFileDialog
            ofd.Filter = "Image Files|*.jpg;*.bmp;*.png;*.gif"
            ofd.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.Desktop
            ofd.Multiselect = True
            ofd.RestoreDirectory = True
            ofd.Title = "Select the files that you want to add to the the list"
    
            If ofd.ShowDialog() = DialogResult.OK Then
                PictureBox1.Image = Image.FromFile(ofd.FileName)
            End If

    And also how to keep converting other vb.net codes so 

    Thanks and I am really appreciated any help

    Saturday, October 6, 2018 2:48 AM

Answers

  • Hello,

    Do you understand that code to open file will be executed on the client side?

    HTML

    <div class="col-lg-6 col-md-6 col-sm-6">
                        <button class="button-analyse" id="btnSelect">select file</button>
        </div>

    JS + JQuery

    $("#btnSelect").click(function(){
            var $input = $('<input type="file" />');
            $input.change(function() {
              alert("selected file:"+$(this).val());
            });
            $input.trigger('click');
        });


    Sincerely, Highly skilled coding monkey.

    • Marked as answer by Max45-1 Sunday, October 7, 2018 12:10 AM
    Saturday, October 6, 2018 10:09 AM