Autor Beitrag
Ryazor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: So 02.03.03 21:33 
Tachchen Leute!
Ich hab n Prob (wiedermal :) ).
Ich möchte unter WinXP ne einfache Inet Connection mit der DFÜ-Standartverbindung aufbauen. Da gibt's ja auch sone komische Funktion (ich weiß jetzt nicht genau, wie die hieß). Leider funzte der bei mir nicht :(
Weiß einer von euch nen Rat? THX :D
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: So 02.03.03 23:05 
Hier ein Beispiel, was ich mal irgendwo im Internet gefunden habe :
ausblenden volle Höhe 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:
unit Unit1;

{ This unit shows how you can establish a connection to the internet without any
  user interaction.}
{ Diese Unit zeigt, wie eine Verbindung zum Internet aufgebaut werden kann, ohne
  dass der Benutzer eingreifen muss.}

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    edtEntry: TEdit;  // holds the name of the connection, e.g. 'bluewin'
    edtUser: TEdit;   // the username for the above connection
    edtPass: TEdit;   // and the password
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses shellapi;
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  cmd, par, fil, dir: PChar;
begin
  // establish the connection
  // die Verbindung aufbauen
  // rasdial.exe entryname username password
  cmd := 'open';
  fil := 'rasdial.exe';
  par := PChar(edtEntry.Text + ' ' + edtUser.Text + ' ' + edtPass.Text);
  dir := 'C:';
  // call rasdial.exe with Shellexecute
  // rasdial mit Shellexecute aufrufen
  ShellExecute(Self.Handle, cmd, fil, par, dir, SW_SHOWMINNOACTIVE);
end;


procedure TForm1.Button2Click(Sender: TObject);
var
  cmd, par, fil, dir: PChar;
begin
  // disconnect the connection to the Internet
  // Verbindung zum Internet abbrechen
  cmd := 'open';
  fil := 'rasdial.exe';
  par := PChar(edtEntry.Text + ' /DISCONNECT');
  dir := 'C:';
  ShellExecute(Self.Handle, cmd, fil, par, dir, SW_SHOWMINNOACTIVE);
end;

end.
Ryazor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: Di 04.03.03 16:14 
Klappt leider nicht wirklich :(
Bei mir meldet mein Delphi ab der Zeile
cmd := 'open';
den Fehler: Illegal Charakter Input File... :cry:

// EDIT:
Ahh, es klappt doch!! Vielen Dank an den Antworter :)
Mein Fehler war, dass ich vor der Zeile "cmd" ein Tabstop gesetzt hab, ohne ihn meckert Delphi nicht :D


Zuletzt bearbeitet von Ryazor am Di 04.03.03 17:07, insgesamt 1-mal bearbeitet
BungeeBug
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 901



BeitragVerfasst: Di 04.03.03 17:04 
dann schau doch mal bei Torry -> www.torry.net da gibbet bestimmt ne Komponente die dir da helfen kann

MfG BungeeBug
Ryazor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: Di 04.03.03 17:08 
Nene, hat schon geklappt (s. mein Edit).
Aber dennoch THX :D
Rachid
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Di 06.05.03 17:03 
Titel: rasdialexe
was wäre wenn kein phonebookentry existiert ???
was gibt rasdial für einen Ruckgabe Wert ???