[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."))
Share This Thread :

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

Related Threads
Thread Author Replies Views Last Post
  OGads - How to change some words into bold in the file download locker? Lone Wolf 3 863 2018-08-04, 12:47 AM
Last Post: CreateAutomate
  Aeonsofts VB.NET Theme Manager v2.1 lanzye 31 12,925 2017-10-28, 04:48 PM
Last Post: waiphyoe
  help in file css vip2 1 1,123 2016-11-25, 12:36 AM
Last Post: torothemes
  .Net Expert Required insomniac 6 1,978 2016-09-08, 08:38 PM
Last Post: styx
  [C++] Finding, reading and using CSV file in C++. Lukasz 4 1,420 2016-09-08, 10:35 AM
Last Post: styx

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

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