Article View: borland.public.jbuilder.java.api
Article #1402Re: dial-up and RAS
From: Rich Wilkman
Date: Fri, 22 Feb 2002 22:34
Date: Fri, 22 Feb 2002 22:34
35 lines
2154 bytes
2154 bytes
Gerry:
Does it work on all Windows platforms that support RAS? Pretty sure it
won't as you may need to modify your exec string to match the OS
flavor. Which ones have you tested this on -- that info will help those
who may try your suggestion.
-Rich
Gerry Smith wrote:
>
> 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:
<3C76C764.647B7797@formlessvoid.com>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!dnewsReferences:
<3c769acb$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,545bad4212906560 X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-02-22 14:39:41 PST Message-ID: <3C76C764.647B7797@formlessvoid.com> Date: Fri, 22 Feb 2002 14:34:12 -0800 From: Rich Wilkman <richw@formlessvoid.com> Reply-To: richw@formlessvoid.com X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.api Subject: Re: dial-up and RAS References: <3c769acb$1_1@dnews> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 208.236.69.60 X-Trace: dnews 1014417250 208.236.69.60 (22 Feb 2002 14:34:10 -0800) Lines: 35 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