Article View: borland.public.cppbuilder.nativeapi
Article #8075Login always successful
From: Alex
Date: Thu, 02 Dec 2004 01:35
Date: Thu, 02 Dec 2004 01:35
22 lines
1585 bytes
1585 bytes
Dear all,
I am now writing a program which use WNetAddConnection2 to login to
another PC in the network. I am using the following codes to login.
However, I found a problem that I can always the the value 0 (Successful)
for WNetAddConnection2 function even I use the wrong login name and
password. Can any one tell me how can i solve this problem? Thank you for
all of your help.
NETRESOURCE nr;
nr.lpLocalName = "";
nr.dwType = RESOURCETYPE_ANY;
nr.dwDisplayType = RESOURCEDISPLAYTYPE_SERVER;
nr.lpProvider = "";
nr.lpRemoteName = "\\\\192.168.0.15";
HRESULT dwResult = WNetAddConnection2((LPNETRESOURCE)&nr,
"wrongloginname", "wrongpassword", 0);
// dwResult will always get zero
Alex
Technical Details
Message-ID:
<41ae7157@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,777efdbd0dd2936e,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Alex" <a@a.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Login always successful Date: Thu, 2 Dec 2004 09:35:16 +0800 Lines: 25 Organization: yung X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 202.71.239.213 Message-ID: <41ae7157@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1101951319 202.71.239.213 (1 Dec 2004 17:35:19 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail