Hi
I want to know how to know if user is running the program for first time?
I have a .txt file which will be loaded on start, but it is the first time and there is no such file.
If anybody contributes, I will be happy
Thanks in advance
Yuvjeeth
yuvjeeth
0
Newbie Poster
Recommended Answers
Jump to PostIf you add a reference(Project menu) to Microsoft Scripting Runtime, you'll have access to the FilesystemObject which has a FileExists method. Using that should give you what you want.
btw joshl_1995 that's .net code
Jump to PostYou can use this following code :
Private Sub Form_Load() If Dir$("D:\dani.txt", vbNormal) = "" Then MsgBox "This is your first time" Else ' Do anything if text file exist End If End Sub
All 6 Replies
joshl_1995
22
Twisted Digital
tinstaafl
1,176
Posting Maven
Jx_Man
987
Nearly a Senior Poster
Featured Poster
mridul.ahuja
4
Coding Enthusiast
rishif2
57
Posting Whiz in Training
mridul.ahuja
4
Coding Enthusiast
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.