[VB.NET] File Exists
2013-06-16, 07:26 PM,
(This post was last modified: 2013-06-16, 07:27 PM by GraveYard.)
I need a code to check if code.txt exist in the same folder with the generator.

I found a lot of codes on the internet, but at all i need to put a path, and i don't know the path, maybe the folder is on desktop (C->USER->Administrator->Desktop) or in D (D:/HackNike)

And i need a code to check if code.txt is in HackNike folder. Without to specific the path, like

Dim curFile As String = "D:\HackNike \code.txt"
Console.WriteLine(If(File.Exists(curFile), "File exists.", "File does not exist."))
2013-06-16, 08:10 PM,
(This post was last modified: 2013-06-16, 08:11 PM by street1920.)
If the code.txt is in the same dir of the executable
dim curfile as string = application.startuppath & "/code.txt"
2013-06-16, 08:48 PM,
hmm, i have some errors
Error 1 'file' is not declared. It may be inaccessible due to its protection level. D:\Hacks\xx\xx\Form1.vb 38 15
2013-06-16, 08:54 PM,
(This post was last modified: 2013-06-16, 08:57 PM by street1920.)
you have to import system.io, so before the class declaraion just write "Imports System.IO"


PHP Code:
Imports System.IO

Public Class Form1

yourcode here

2013-06-16, 09:42 PM,
THX man, now working
Dim curfile As String = Application.StartupPath & "/code.txt"
If (File.Exists(curfile)) Then
MsgBox("File exist")
MsgBox("file does not exist")
End If

2013-06-16, 09:50 PM,
=) I'm here to help :D

Possibly Related Threads...
Thread Author Replies Views Last Post
  Aeonsofts VB.NET Theme Manager v2.1 lanzye 29 9,737 2017-06-20, 06:55 PM
Last Post: storix
  help in file css vip2 1 824 2016-11-25, 12:36 AM
Last Post: torothemes
  .Net Expert Required insomniac 6 1,541 2016-09-08, 08:38 PM
Last Post: styx
  [C++] Finding, reading and using CSV file in C++. Lukasz 4 1,116 2016-09-08, 10:35 AM
Last Post: styx
  [HELP] How to Change Cpagrip Url / File locker Favicon ? ashu55 2 1,268 2016-08-24, 06:35 PM
Last Post: ashu55

About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top