Autor Beitrag
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 30.07.05 16:17 
Hallo!
Gibt es eine Möglichkeit, die Gesmamtgröße aller über DSL downgeloadeten Daten (auch Interetseiten im Browser, etc.) zu bestimmen. Da sProg wäre im Hintergrund immer aktiv und würde dies protokollieren.


Ich wusste beim besten Willen nicht nach was ich suche sollte.


mfg
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Sa 30.07.05 16:21 
Ich glaube mit dem T-DSL SpeedManager ist das möglich.

_________________
Ciao, Sprint.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 30.07.05 16:31 
Mit der IPhelpAPI geht das. www.luckie-online.de/Developer/Delphi/Alt/ -> InternetMonitor
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: So 31.07.05 11:22 
Danke. Ich achau's mit an und melde mich dann aber wieder frühestens in 1ner Woche (Urlaub *freu*).

//Edit:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
function GetSessionTraffic: Cardinal;
var
  IfTable: PMIB_IFTABLE;
  dwSize: Cardinal;
  i: Integer;
begin
  result := 0;
  IfTable := nil;
  dwSize := 0;
  ZeroMemory(@IfTable, sizeof(IfTable));
  try
    VVGetIfTable(IfTable, dwSize, TRUE);
    if IfTable <> nil then
    begin
      for i := 0 to IfTable.dwNumEntries - 1 do
      begin
        if IfTable.table[i].dwType <> MIB_IF_TYPE_LOOPBACK then
          result := IfTable.table[i].dwInOctets + IfTable.table[i].dwOutOctets;
      end;
    end;
  finally
    Freemem(IfTable);
  end;
end;

function IsOnlineThread(p: Pointer): Integer;
var
  dwResult: DWORD;
  bWentOnline: Boolean;
  s, s1: string;
  intTotal, intCurrent: Integer;
begin
  result := 0;
  bWentOnline := FALSE;
  InterlockedExchange(bRunning, 1);
  while bRunning <> 0 do
  begin
    if InternetGetConnectedState(@dwResult, 0then
    begin
      bWentOnline := TRUE;
      SetDlgItemText(hApp, STC_SESSIONTIME,
        pointer(FormatTime(TimeDiffFromNow.QuadPart)));
      SetDlgItemText(hApp, STC_TOTALTIME,
        pointer(FormatTime(RegReadInteger(SETINGSPATH, 'TotalTime') +
        TimeDiffFromNow.QuadPart)));

      intCurrent := GetSessionTraffic();
      intTotal := RegReadInteger(SETINGSPATH, 'TotalTraffic');
      s := Format('%.2f', [intCurrent / 1024 / 1024]);
      SetDlgItemText(hApp, STC_SESSIONTRAFFIC, pointer(s));
      s1 := Format('%.2f', [(intTotal + intCurrent) / 1024 / 1024]);
      SetDlgItemText(hApp, STC_TOTALTRAFFIC, pointer(s1));

      s := '';
      s1 := '';
      sleep(1000);
    end
    else
    begin
      if bWentOnline = TRUE then
      begin
        bWentOnline := FALSE;
        SaveTotals();
        WriteLogFile();
      end;
      GetLocalTime(stStart);
      //GetSystemTime(stStart);
    end;
  end;
end;


Gehe ich richtig in der Annahme, dass das die Codestellen sind die meine Frage beantworten?
(Dadurch, dass ich bis jetzt nur mit VCLFormularanwenungen gearbeitet hab is das abrebeiten in der mehr ober weniger 'neuen' Umgebung schon verwirrender)

mfg
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mo 08.08.05 10:21 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
function GetSessionTraffic: Cardinal;
var
  IfTable: PMIB_IFTABLE;
  dwSize: Cardinal;
  i: Integer;
begin
  result := 0;
  IfTable := nil;
  dwSize := 0;
  ZeroMemory(@IfTable, sizeof(IfTable));
  try
    VVGetIfTable(IfTable, dwSize, TRUE);
    if IfTable <> nil then
    begin
      for i := 0 to IfTable.dwNumEntries - 1 do
      begin
        if IfTable.table[i].dwType <> MIB_IF_TYPE_LOOPBACK then
          result := IfTable.table[i].dwInOctets + IfTable.table[i].dwOutOctets;
      end;
    end;
  finally
    Freemem(IfTable);
  end;
end;

Eigentlich müsste ich nur dass hier brauchen, oder gibtted da noch was zu beachten?
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mo 08.08.05 17:22 
Ok, ich hab's hinbekommen, war ganz leicht.
Danke für die Hilfe.

Noch eine Frage: Die function GetSessionTraffic, gibt die die runtergeladenen, oder runter- und hochgeladenen Dateigrößen zurück?
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 08.08.05 17:59 
Rat mal:
ausblenden Delphi-Quelltext
1:
result := IfTable.table[i].dwInOctets + IfTable.table[i].dwOutOctets;					
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5284
Erhaltene Danke: 27

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 02.11.05 19:52 
user profile iconLuckie hat folgendes geschrieben:
Mit der IPhelpAPI geht das. www.luckie-online.de/Developer/Delphi/Alt/ -> InternetMonitor


Könntest du den Link bitte aktualisieren, einen anderen posten oder es hier hochladen ? Danke :wink:
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mi 02.11.05 20:02 
Ich hoffe es ist user profile iconLuckie recht wenn ich es hochlade.
Einloggen, um Attachments anzusehen!
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5284
Erhaltene Danke: 27

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 02.11.05 20:35 
jetzt kann er nichts mehr machen, habs grad geladen, danke :wink:
JayK
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Fr 03.02.06 17:08 
So ich hab ja jetzt sowas auch gerade gebraucht, Luckies aktuelle URL für den Internetmonitor ist www.luckie-online.de.../InternetMonitor.zip ;-)