please help drag drop text file to exe

lekner

Member
Joined
Sep 18, 2007
Messages
5
Programming Experience
Beginner
i am new and have basic knoledge in vb.net
all my programing until today was calculation
i have been asked to create a small software that will manipulate text file
the problem is that they want it to start by draging and droping to exe file
how i make it
that any text file i will drag into the exe file will be loaded to a text box?
or to the memory and will be manipulated?
thank you very much
and how i check it?
:rolleyes:
 
how i make it
that any text file i will drag into the exe file will be loaded to a text box?

VB.NET:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim args() As String = Environment.GetCommandLineArgs()
        If args.Length > 1 Then
            Me.Text = args(1)
            If System.IO.Path.GetExtension(args(1)) = ".txt" Then
                Me.TextBox1.Text = My.Computer.FileSystem.ReadAllText(args(1))
            Else
                Me.TextBox1.Text = "Not a valid *.txt file."
            End If
        End If
    End Sub

End Class
 
stonkie thanks for the link

ajeeshco hit the target
i will use your link if i need to use drag and drop inside the form
thank you both
 
Back
Top