Hi Monks,
The following code results in a Perl Command Line Interpreter error message at this line
InternetSetOption(NULL, INTERNET_OPTION_REFRESH , NULL, 0);
.
Error Message: Perl Command Line Interpreter has encountered a problem and needs to close. We are sorry for the inconvenience.
use Win32::Registry;
use Win32::API::Prototype;
my $infile = "c:\\proxies.txt";
open (PFILE, $infile) || die "cannot Open $infile: $!";
my @proxies = (<PFILE>);
my $proxy;
foreach $proxy (@proxies){
my $Register = "Software\\Microsoft\\Windows\\CurrentVersion\\In
+ternet Settings";
my $hkey;
$HKEY_CURRENT_USER->Open($Register,$hkey)|| die $!;
undef $garbage;
$hkey->SetValueEx("ProxyServer",$garbage,REG_SZ,$proxy);
$hkey->Close();
print "Current: $proxy\n";
ApiLink( "wininet", "BOOL InternetSetOption(
HINTERNET hInternet,
DWORD dwOption,
LPVOID lpBuffer,
DWORD dwBufferLength
)" ) || die;
InternetSetOption(NULL, INTERNET_OPTION_REFRESH , NULL, 0);
sleep(30);
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.