Article View: borland.public.jbuilder.java.api
Article #1401dial-up and RAS
From: Gerry Smith
Date: Fri, 22 Feb 2002 20:16
Date: Fri, 22 Feb 2002 20:16
24 lines
1814 bytes
1814 bytes
I've seen a few posts about trying to use RAS, including mine.
Clearly the best way to access RAS would be through JNI. It's easy to find
free controlls intended for use in VB or C++ which could be utilised to gain
control of RAS and detect current status etc.
However, for a 'quick & dirty' solution the following may be found useful.
Gerry Smith
gerry@patriot-pi.com
// entry = phonebook entry you wish to dial
// user = username for logging on to network with RAS
// pword = password for logging on to network with RAS
char[] buff = new char[400];
String response;
Process ras = Runtime.getRuntime().exec("RASDIAL "+entry+" "+user+"
"+pword);
BufferedReader br = new BufferedReader(new
InputStreamReader(ras.getInputStream()));
ras.waitFor();
br.read(buff);
response = new String(buff);
System.out.println(response.trim());
Technical Details
Message-ID:
<3c769acb$1_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!128.230.129.106!news.maxwell.syr.edu!news.mel.connect.com.au!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,545bad4212906560,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-02-22 11:32:09 PST Reply-To: "Gerry Smith" <gerry@patriot-pi.com> From: "Gerry Smith" <gerry@patriot-pi.com> Newsgroups: borland.public.jbuilder.java.api Subject: dial-up and RAS Date: Fri, 22 Feb 2002 13:16:01 -0700 Lines: 32 Organization: Patriot Protection Services X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 172.146.207.5 Message-ID: <3c769acb$1_1@dnews> X-Trace: dnews 1014405835 172.146.207.5 (22 Feb 2002 11:23:55 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!128.230.129.106!news.maxwell.syr.edu!news.mel.connect.com.au!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!dnews