Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query Active Directory
Message
 
À
05/10/2007 15:53:51
Scott Sherman
Puyallup Tribal Health Authority
Tacoma, Washington, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01259047
Message ID:
01259069
Vues:
14
Scott,

Something like this helps you?
local loConnection, loSessions, loSession

lcServer			= "SKYAPPS"
loConnection			= GetObject("WinNT://" + lcServer + "/LanmanServer")
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
[Update]

Crap, now I notice I do not have the date time when the connection started, one of your requisites, sorry.

For it you can use Datetime() - C_Sessions.ConnectedTime
[/Update]
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform