Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Aug 4, 1997



Application Security Testing: An Integral Part of DevOps

"File Exists?" Revision

To adapt the tip "File Exists?" (see "101 Hot Tech Tips for VB Developers," Supplement to the August 1996 issue of VBPJ, page 7) to a directory list box, it is necessary to control the error that occurs when the user selects the root (C:\):
Sub Dir1_Change
	Dim File As String
	File = Dir1.Path
	If Right$(File, 1) = "\" Then
		File = File & "himem.sys"
		File = File & "\" & "himem.sys"
	End If
	' Chuong Van Huynh's tip 
	If Dir$(File) <> "" Then
		MsgBox "himem.sys exists !"
	End If
End Sub
Without testing to see if the path already ends with a backslash, as it would when it's the root directory, an error occurs because of the string "c:\\himem.sys."
Michel Rohan
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date