Hello everyone i like to aks you can someone help me with one code in VB or C#

Status
Not open for further replies.

Justin Toredo

New Member
Thread author
Nov 19, 2014
1
So this is my problem I have to make a program that is going to list a path of files opened with openfiledialog
and after that to put them into list(of Something ) and to open another form like form2 and there in label to show the result = File path
but the problems is that I need to make it work in real-time like if the teacher wants to open another file to open it and again to be show in form2 label1
some suggestions ?
 
Last edited by a moderator:
  • Like
Reactions: mercurial

jamescv7

Level 85
Verified
Honorary Member
Mar 15, 2011
13,070
Well I will provide you this type of demonstration where it deals on openfiledialog. Hope you can solve this to your own by manipulation. :)

KoCpaMW.jpg


You can see by clicking open button then select file, a message box will be shown and added already in the listbox.

CEc4VME.jpg


1SrE7F4.jpg


Code:
  Dim open As New OpenFileDialog
        Dim res As String
        Dim names As String
        open.ShowDialog()

        open.Filter = "All Files(*.*)|*.*"
        names = open.FileName

        If IO.File.Exists(names) Then
            MsgBox("You have select:" + names, MsgBoxStyle.Information)
            ListBox1.Items.Add(names)
            res = MsgBox("Do you want to open it?", MsgBoxStyle.Question + MsgBoxStyle.YesNo)
            If res = vbYes Then
                System.Diagnostics.Process.Start(names)

            Else

            End If
        End If

    End Sub
 
Status
Not open for further replies.

About us

  • MalwareTips is a community-driven platform providing the latest information and resources on malware and cyber threats. Our team of experienced professionals and passionate volunteers work to keep the internet safe and secure. We provide accurate, up-to-date information and strive to build a strong and supportive community dedicated to cybersecurity.

User Menu

Follow us

Follow us on Facebook or Twitter to know first about the latest cybersecurity incidents and malware threats.

Top