CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
AddConnection function

 



bradleyb
Deleted

Feb 26, 2000, 8:15 PM

Post #1 of 5 (6928 views)
AddConnection function Can't Post

Can someone provide a real life example on how to properly use the AddConnection function of PERL on a Windows NT box? I want to be able to access a directory on another service which already has a drive mapped to it, but Perl doesn't recognize it by that drive letter, so I figure I have to make PERL map it itself.

I have three books, and none provide an example on how to actually use this command.

Thanks.



Cure
User

Feb 27, 2000, 3:36 PM

Post #2 of 5 (6928 views)
Re: AddConnection function [In reply to] Can't Post

Hi bradleyb

PERL doesnt have a bulit-in AddConnection function.

Cure


japhy
Enthusiast

Feb 27, 2000, 4:16 PM

Post #3 of 5 (6928 views)
Re: AddConnection function [In reply to] Can't Post

Cure, he's referring to Win32::NetResource::AddConnection().


bradleyb
Deleted

Mar 8, 2000, 11:39 PM

Post #4 of 5 (6928 views)
Re: AddConnection function [In reply to] Can't Post

Does anyone have the code to establish a network connection within PERL?

This would really help me out a lot.



bradleyb
Deleted

Mar 9, 2000, 3:19 PM

Post #5 of 5 (6928 views)
Re: AddConnection function [In reply to] Can't Post

The following gets to the AddConnection function but fails everytime. The net resource information is correct and I use valid User and Password values.

Any ideas please?

Brad

use CGI;

print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>Adminsitrator LOG Search v0.001a 000226</TITLE>\n";
print "</HEAD>\n";

use Win32::NetResource;
%NetResource = (
LocalName => "R:",
RemoteName => "\\\\wldgrp\\wss2g1"
);

print "STEP 1<br>";

$User = "";
$Password = "";

print "STEP 2<br>";

if( Win32::NetResource::AddConnection(\%NetResource, $Password, $User, 1 ))

{
print "Successful!<br>";
}
else
{
print "Not Successful<br>";
}

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives