Autor Beitrag
Lucky
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 84

XP
Delphi 7
BeitragVerfasst: Mo 28.04.08 10:55 
Hallo,
hab mal wieder ein Problem. u. zwar wenn ich über rechte maustaste netzlaufwerk verbinden gehen muss ich keinen benutzername u. kennwort angeben, wenn ich nun allerdings über untigen quellcode das gleiche mach kommt immer fehler: 5... ne idee?
vielen dank schon mal im voraus
chris
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
      with netresource do
      begin
        dwType       := RESOURCETYPE_DISK;
        lplocalname  := 'B:';
        lpremotename := '\\sqlsrv\srvdsk\plotter';
        lpProvider   := nil;
      end;

      dwflags := CONNECT_UPDATE_PROFILE;
      result  := WNetAddConnection2(netresource,'','',0);
      if result = NO_ERROR then
          showmessage('OK')
      else
          showmessage(Format('Fehler %d',[result]));
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19275
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 28.04.08 12:22 
Wenn du keinen Benutzernamen und Passwort angibst, dann wird der aktuelle Benutzer des PCs benutzt und dessen Passwort...
Und wenn es den auf dem anderen PC nicht gibt, dann geht das nicht.
Lucky Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 84

XP
Delphi 7
BeitragVerfasst: Mo 28.04.08 12:47 
ok, aber ich mach das ja hier an meinem pc u. wenn ich das per maus mache funktioniert das, nur net mit dem quellcode net...
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mo 28.04.08 18:26 
Der Windows Explorer speichert manche dieser Passwörter zwischen und lädt diese bei Bedarf, dein Programm nicht.

AXMD