[Delphi]Hoe IIS info achterhalen

Pagina: 1
Acties:

  • BasieP
  • Registratie: Oktober 2000
  • Laatst online: 19-10-2025
Ik wou een programmatje maken dat de serverstatus afleest. Hiervoor heb ik ff gezocht, en kreeg dit op IRC:
Op weetikveel screef Jo het volgende:
for IIS: use pdh.dll
these functions:
code:
1
2
3
4
5
6
Public Declare Function PdhVbOpenQuery Lib "PDH.DLL" (ByRef QueryHandle As Long) As Long
Public Declare Function PdhCloseQuery Lib "PDH.DLL" (ByVal hQuery As Long) As Long
Public Declare Function PdhVbAddCounter Lib "PDH.DLL" (ByVal QueryHandle As Long, ByVal CounterPath As String, ByRef CounterHandle As Long) As Long
Public Declare Function PdhRemoveCounter Lib "PDH.DLL" (ByVal CounterHandle As Long) As Long
Public Declare Function PdhCollectQueryData Lib "PDH.DLL" (ByVal QueryHandle As Long) As Long
Public Declare Function PdhVbGetDoubleCounterValue Lib "PDH.DLL" (ByVal CounterHandle As Long, ByRef CounterStatus As Long) As Double

Note that this is in C++ ^
you can retrieve about anything using pdh.dll (but it's 2k, and possibly XP only)
code:
1
%SystemRoot%\system32\perfmon.msc /s

try running that, it'll show all the possible statistics
right-click the right pane -> add counter
Nu heb ik dat geprobeerd, maar ik kom er niet uit. Ik draai zelf ook geen Win2k/XP en laat staan een IIS server, maar kan iemand me hierbij helpen?

This message was sent on 100% recyclable electrons.


  • Creepy
  • Registratie: Juni 2001
  • Laatst online: 18:04

Creepy

Tactical Espionage Splatterer

*zucht*

[no flame intended]
Raad eend wat je kan vinden als je de termen PDH en DELPHI intype bij www.google.com en community.borland.com. en natuurlijk is er ook nog de MSDN library

Ik had gehoopt dat je o.a. wel zou weten hoe je voorbeelden van code kon zoeken.

* Creepy vraagt zich zomaar af waar je de stats in Smartie vandaan haalt onder NT/2000/XP.
[/no flame intended]

Hmm.. nou vooruit :)

* Creepy heeft een PDH.pas liggen (das gewoon de pdh.h vertaalt naar Delphi dus).
Als je die include kan je de functies uit de PDH library gewoon gebruiken. Werkt prima onder XP/2000, alleen niet onder NT. Voor NT zul je de PDH.DLL mee moeten leveren. Je moet natuurlijk wel ff zelf uitzoeken hoe je precies met de PDH omgaat, maar zoals al eerder gezegd is dat vrij makkelijk te vinden.

edit:
Nee, heb die .h file niet zelf omgezet, lang leve project jedi dacht ik zo. Kijk ff op http://www.delphi-jedi.org/Jedi:APILIBRARY:22907 en zoek de PerfMon.zip

"I had a problem, I solved it with regular expressions. Now I have two problems". That's shows a lack of appreciation for regular expressions: "I know have _star_ problems" --Kevlin Henney


  • BasieP
  • Registratie: Oktober 2000
  • Laatst online: 19-10-2025
Op maandag 17 december 2001 22:27 schreef Creepy het volgende:
* Creepy vraagt zich zomaar af waar je de stats in Smartie vandaan haalt onder NT/2000/XP.
nou iig niet daaruit...

maar thanx alot
en ik kon wel dingen vinden op google maar die waren voor C++, en ik ben nogal slecht in omzetten van C++ --> Delphi visa versa

This message was sent on 100% recyclable electrons.


  • Creepy
  • Registratie: Juni 2001
  • Laatst online: 18:04

Creepy

Tactical Espionage Splatterer

Ach ja.. header files omzetten van C(++) naar Delphi is een deel van m'n werk. M'n chef verdomt het om een normale C(++) compiler (lees VC++ of BC++ Builder) aan te schaffen omdat we Delphi al in huis hebben.

Best vervelend als je weer eens een header file hebt die je in Delphi moet gaan gebruiken. Maar ja.

Zou je me kunnen vertellen waar je die stats in Smartie wel vandaan haalt dan? Ik gebruik in ieder geval de PDH in LCDinf (in de NT/XP/2000 versie dan).

"I had a problem, I solved it with regular expressions. Now I have two problems". That's shows a lack of appreciation for regular expressions: "I know have _star_ problems" --Kevlin Henney


  • Servowire
  • Registratie: September 2000
  • Laatst online: 14-09 21:39

Servowire

prutser:~#

Waarom gaan lcdinf en Smartie niet samen?

O+

met papier mache kun je alles maken!!


Verwijderd

je bedoeld buiten het feit dat de schrijvers van beide programma's niet door 1 deur lijken te kunnen gaan?

  • Onno
  • Registratie: Juni 1999
  • Niet online
Op maandag 17 december 2001 20:51 schreef basiep het volgende:
for IIS: use pdh.dll
these functions:
code:
1
2
3
4
5
6
Public Declare Function PdhVbOpenQuery Lib "PDH.DLL" (ByRef QueryHandle As Long) As Long
Public Declare Function PdhCloseQuery Lib "PDH.DLL" (ByVal hQuery As Long) As Long
Public Declare Function PdhVbAddCounter Lib "PDH.DLL" (ByVal QueryHandle As Long, ByVal CounterPath As String, ByRef CounterHandle As Long) As Long
Public Declare Function PdhRemoveCounter Lib "PDH.DLL" (ByVal CounterHandle As Long) As Long
Public Declare Function PdhCollectQueryData Lib "PDH.DLL" (ByVal QueryHandle As Long) As Long
Public Declare Function PdhVbGetDoubleCounterValue Lib "PDH.DLL" (ByVal CounterHandle As Long, ByRef CounterStatus As Long) As Double

Note that this is in C++ ^
you can retrieve about anything using pdh.dll (but it's 2k, and possibly XP only)
:D :D

Dat is dus *geen* C++ he, maar Basic. :D

  • BasieP
  • Registratie: Oktober 2000
  • Laatst online: 19-10-2025
Op maandag 17 december 2001 23:12 schreef Creepy het volgende:

Zou je me kunnen vertellen waar je die stats in Smartie wel vandaan haalt dan? Ik gebruik in ieder geval de PDH in LCDinf (in de NT/XP/2000 versie dan).
welke stats bedoel je?
die van je hardeschijven enzo?
die heb ik eens van internet (ik geloof torry.net) gedowned, en toen ingebouwd.
het is gewoon een los .pas filetje
Op dinsdag 18 december 2001 01:18 schreef Yarvieh het volgende:
je bedoeld buiten het feit dat de schrijvers van beide programma's niet door 1 deur lijken te kunnen gaan?
hehe, ik ben bang dat dat idd zo is.. sorry creepy, ik heb nix tegen je, maar ik ben af en toe wel een beetje lui ;)
Op dinsdag 18 december 2001 01:20 schreef Onno het volgende:

[..]

:D :D

Dat is dus *geen* C++ he, maar Basic. :D
oops.. kun je nagaan wat ik er van snap :+

This message was sent on 100% recyclable electrons.

Pagina: 1