Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Who has file open
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01382579
Message ID:
01382722
Vues:
46
>>Can you show the sample of the server name and where can I check it?
>>
>>Thanks again.
>
>Naomi,
>
>I do not think I understood your question.

I tried
* Open Sessions
local loConnection, loSessions, loSession

lcServer			= "The Name I suppose is the name"
loConnection			= GetObject("WinNT://" + lcServer + "/LanmanServer")

&& And got an error here - moniker can not open the file

&& So, what should I try

loSessions			= loConnection.Sessions()

create cursor C_Sessions ;
	( ;
		PK			I 		autoinc	, ;
		Computer		C(64)			, ;
		ConnectedTime		I			, ;
		IdleTime		I			, ;
		Name			C(64)			, ;
		User			C(64)			  ;
	)

For Each loSession in loSessions
	wait window 'Adding: ' + loSession.Name nowait
	with loSession
		try
			insert into C_Sessions ;
					(	;
						Computer				, ;
						ConnectedTime			, ;
						IdleTime				, ;
						Name					, ;
						User					  ;
					) ;
				values ;
					( ;
						.Computer				, ;
						.ConnectTime			, ;
						.IdleTime				, ;
						.Name					, ;
						.User					  ;
					)
		catch
		endtry
	endwith
endfor

wait window 'Creating indexes...' nowait

index on	PK			tag PK
index on	Computer	tag Computer
index on	Name		tag Name
index on	User		tag User

wait clear


* Open Files
local loConnection, loResources, loResource, llValid

lcServer			= "YourServerName"
loConnection			= GetObject("WinNT://" + lcServer + "/LanmanServer")
loResources			= loConnection.Resources()

create cursor C_Resources ;
	( ;
		PK		I Autoinc		, ;
		Name	C(240)			, ;
		User	C(64)			, ;
		Path	C(240)			, ;
		ADsPath	C(240)			, ;
		GUID	C(64)			, ;
		Schema	C(240)			, ;
		Locks	I				  ;
	)
		
For Each loResource in loResources
	with loResource
		try
			lcPath					= .Path
			llValid					= .t.
		catch
			llValid					= .f.
		endtry
		if llValid
			wait window 'Adding resource: ' + .Path nowait
			insert into C_Resources ;
					( ;
						User				, ;
						Name				, ;
						Path				, ;
						Locks				  ;
					) ;
				values ;
					( ;
						.User				, ;
						.Name				, ;
						.Path				, ;
						.LockCount			  ;
					)
		endif
	endwith
endfor

wait window 'Creating indexes...' nowait

index on	PK		tag PK
index on	Path		tag Path
index on	User		tag User

wait clear
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform