Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test for network folder
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00816812
Message ID:
00817264
Views:
20
Hello James,
>>>
>>>I'm looking for a simple sample of code to test for a network folder.
>>>
>>>If it's not available (user not logged on) a message appears to advise user to quit the local application and logon to the network.
>>>
>>>This would happen when they try to copy of file to the server.
>>>

Try it:
l_cPict=""
For l_nCurDrv = 65 TO 91
	l_nType = DRIVETYPE(CHR(l_nCurDrv))
	Do CASE
		Case l_nType = 2
			*--floppy
			l_cPict = "floppy"
		Case l_nType = 3
			*--harddrive
			l_cPict = "harddrive"
		Case l_nType = 4
			*--network or removable
			l_cPict = "netdrive"
		Case l_nType = 5
			*--CDROM
			l_cPict = "cdrom"
		Otherwise
			*--no type or ram disk
			l_cPict = ""
	Endcase
	If !EMPTY(l_cPict)
		l_cDrive = CHR(l_nCurDrv)+":"
		*.ADD("Mycomp",4,l_cDrive,CHR(l_nCurDrv),l_cPict)
		? l_cDrive
	Endif
Endfor
HTH

Claudio
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform