how to find a file??

Posts 113 of 13 · Page 1 of 1
how to find a file??
Hey

I want to know what the code would be to find a file.

Like say:

If C:\Nexon\Combat Arms\EndingBanner.exe found then
label1.text = Ending Banner Found

else

label1.text = Ending Banner Not Found

Anyone know?

ALSO,

How would i write the a file to a folder. then when you press a button. it removes it.

Thanks
acid_buRn
Ok I posted this somewhere else but here we go

Import this first :
Code:
imports System.IO.File
Now put this where you want:
Code:
If System.IO.File.Exists("C:\Nexon\CombatArms\Endingbanner.exe") = True Then
MsgBox("File Found") ' or what ever
End If
Quote Originally Posted by SPittn_Blood View Post
Ok I posted this somewhere else but here we go

Import this first :
Code:
imports System.IO.File
Now put this where you want:
Code:
If System.IO.File.Exists("C:\Nexon\CombatArms\Endingbanner.exe") = True Then
MsgBox("File Found") ' or what ever
End If
Thanks for that.

Do you know how to write a file to a folder?
Quote Originally Posted by ac1d_buRn View Post
Thanks for that.

Do you know how to write a file to a folder?
wat exactly do you need to do? move a folder to another folder or wat
Quote Originally Posted by ac1d_buRn View Post
Thanks for that.

Do you know how to write a file to a folder?
Add the file to my resorces!

Then add this code:

Code:
Imports System.IO
And
Code:
        Try

            Dim myFile() As Byte = My.Resources.FILENAME
            Dim fileData = New FileStream(C:\...... + "\FILENAME.txt", FileMode.OpenOrCreate)
            Dim BW As New BinaryWriter(fileData)
            Try
                For bt As Integer = 0 To myFile.Length - 1
                    BW.Write(myFile(bt))
                Next
            Catch ex As Exception
                MsgBox(ex.Message.ToString)


            Finally
                fileData.Close()
                BW.Close()

            End Try
            MsgBox("File moved")
        Catch ex As Exception
            MsgBox("Failed")
        End Try
Atleast give me a thanks for this!
Quote Originally Posted by Zoom View Post
Add the file to my resorces!

Then add this code:

Code:
Imports System.IO
And
Code:
        Try

            Dim myFile() As Byte = My.Resources.FILENAME
            Dim fileData = New FileStream(C:\...... + "\FILENAME.txt", FileMode.OpenOrCreate)
            Dim BW As New BinaryWriter(fileData)
            Try
                For bt As Integer = 0 To myFile.Length - 1
                    BW.Write(myFile(bt))
                Next
            Catch ex As Exception
                MsgBox(ex.Message.ToString)


            Finally
                fileData.Close()
                BW.Close()

            End Try
            MsgBox("File moved")
        Catch ex As Exception
            MsgBox("Failed")
        End Try
Atleast give me a thanks for this!
Thank youuu
Quote Originally Posted by ac1d_buRn View Post
Thank youuu
Your welcome!
What does it say in massive green letters in my signature?

Yes I can, but I will post tomorow
Uh where us My Resources?
I cant find it XD

I put it on the solution explorer but it didnt work
click on view. Click solution explorer. right click on resources click add
Quote Originally Posted by stevethehacker View Post
click on view. Click solution explorer. right click on resources click add
Yeah thats right!

Or Options->Resoucres->Put the file in the felt! (I t hink it was that or you can do like steve!
I have always done it my way. I didn't even know about the other way lmao
this is all you need, very very simple

Code:
        Dim fso
        Dim fol As String

        fol = "C:\Nexon\Combat Arms\"
        fso = CreateObject("Scripting.FileSystemObject")


        If Not fso.FileExists(fol + "EndingBanner.exe") Then
            label1.text = Ending Banner Not Found

        Else

            label1.text = Ending Banner Found
        End If
Posts 113 of 13 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?