Autor Beitrag
Ace87
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

Win XP Home, Linux Suse
Delphi 5, C++ Builder 5, Turbo C#
BeitragVerfasst: Mo 04.09.06 13:48 
Ich will einen PrintServer Programmieren, mit dem ich mehrere Dateien über die Print-Funktion(ich benutze Port 8100) aller Benutzer im Netzwerk empfangen kann, diese Lokal auf der Festplatte speichert und dann zum Drucker schiebe.

Das alles sollte am besten über den TIdTCPServer gehen.
Mein Problem ist, dass die empfangenden Daten nicht komplett gespeichert oder sogar gar nicht gespeichert wird.
Wenn die Dateien auf meinem Rechner dann sind, dann ist es kein Problem mehr sie auszudrucken.

Habe Indy 9 und Delphi 7 auf dem Rechner

Würde mich freuen, wenn mir jemand helfen könnte.

Mit freundlichen Grüßen

David
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 04.09.06 14:16 
Moin und :welcome: im Forum!

Nur aus Interesse: Warum gibst du den Drucker nicht im Netzwerk frei oder aktivierst den Druckserverdienst?

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Ace87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

Win XP Home, Linux Suse
Delphi 5, C++ Builder 5, Turbo C#
BeitragVerfasst: Mo 04.09.06 14:21 
weil das ein Firmennetz ist und der Rechner nicht übers Netzwerk angesprochen werden kann.
Bin da nur Praktikan^^
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 04.09.06 14:26 
Moin!

user profile iconAce87 hat folgendes geschrieben:
weil das ein Firmennetz ist und der Rechner nicht übers Netzwerk angesprochen werden kann.

:gruebel: Wenn der Rechner nicht über das Netzwerk angesprochen werden kann, kannst du auch keine Druckdaten mit einem Delphi-Programm empfangen... :nixweiss:

Also, was genau wird das da? ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Ace87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

Win XP Home, Linux Suse
Delphi 5, C++ Builder 5, Turbo C#
BeitragVerfasst: Mo 04.09.06 14:31 
Ne der Rechner ist im Netz.
Aber was weiß ich :P
soll das einfach machen

Bestimmt nur so ne Praktikantenbeschäftigung :P
wäre trotzdem nett, wenn jemand was wüsste^^
Ace87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

Win XP Home, Linux Suse
Delphi 5, C++ Builder 5, Turbo C#
BeitragVerfasst: Di 05.09.06 09:13 
OK

Habe ich schon gelöst ;)
war eigentlich kein Problem

MIT FREUNDLICHEN GRÜßEN

David
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 05.09.06 09:24 
Moin!

Warum stellst du denn deine Lösung nicht hier vor? Dann hätten andere mit diesem Problem einen Ansatz, das ist doch der Sinn eines Forums... ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Ace87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

Win XP Home, Linux Suse
Delphi 5, C++ Builder 5, Turbo C#
BeitragVerfasst: Do 07.09.06 08:24 
Also im ServerConnect habe ich die Datei angelegt
und im ServerDisconnect habe ich die auf den Drucker geworfen und dann gelöscht!!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TServerFrmMain.ServerExecute(AThread: TIdPeerThread);
var
  fStream:TFileStream;
begin
  fStream := TFileStream.Create('printfile'+ IntToStr(AThread.Handle) + '.dat', fmOpenReadWrite);
  AThread.Connection.ReadStream(fStream,-1,true);
  FreeAndNil(fStream);
end;


Mit freundlichen Grüßen

David
Ace87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

Win XP Home, Linux Suse
Delphi 5, C++ Builder 5, Turbo C#
BeitragVerfasst: Do 07.09.06 08:29 
Andere Frage

Verstehe das Prinzip mit dem Dienst nicht.
Würde ja gerne den Print-Server als Dienst laufen lassen
habe mir aber die Hilfe angeschaut und verstehe das nicht
Kann mir jemand helfen??

Mit freundlichen Grüßen

David
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 07.09.06 09:07 
Moin!

user profile iconAce87 hat folgendes geschrieben:
und im ServerDisconnect habe ich die auf den Drucker geworfen und dann gelöscht!!

Wenn du jetzt dazu auch noch deinen Code veröffentlichst, dann ist das Beispiel sogar komplett! :D

user profile iconAce87 hat folgendes geschrieben:
Andere Frage
Verstehe das Prinzip mit dem Dienst nicht.

Neue Frage - neuer Thread! :mahn: ;) Sorry, aber ist hier Forumsregel. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Ace87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

Win XP Home, Linux Suse
Delphi 5, C++ Builder 5, Turbo C#
BeitragVerfasst: Do 07.09.06 09:40 
Ja ok dachte, dass das schieben auf den Drucker und das Löschen bekannt wäre

ausblenden Delphi-Quelltext
1:
2:
CopyFile(PChar('printfile'+ IntToStr(AThread.Handle) + '.dat'), PChar(Edit1.Text), false);
DeleteFile('printfile'+ IntToStr(AThread.Handle) + '.dat');


im Edit1 ist die Drucker kennung drin

Und das mit dem Dienst ist ja gar nicht so wichtig
war nur ne Frage am Rande
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 07.09.06 09:44 
Moin!

user profile iconAce87 hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
CopyFile(PChar('printfile'+ IntToStr(AThread.Handle) + '.dat'), PChar(Edit1.Text), false);					


im Edit1 ist die Drucker kennung drin

Gib doch bitte noch ein Beispiel, wie diese Kennung aussehen könnte, dann haben wir wirklich alles beisammen. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.