• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

connect to Internet using modem and dial up connection

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I've developed an application which works just fine when an open Internet connection is available (using HttpUrlConnection and HttpsUrlConnection). Now I'm looking for possibilities to connect to the Internet using a modem and dial up-connection.
At some point I want my application to connect to the Internet using a modem and also hang up automatically. Is this possible? Which Java API's to use?
Platform is Windows NT. Do I have to communicate with windows 'dial up connection'?
Any help would be appreciated.
Cheers,
-Ruud.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi dear..
i also have same problem , i also want to make application by which i can communicate without using internet..
i saw this project in VB..
i think we have to call some windows API..by using native method..to comunicate to the
low level service....
 
Ruud Steeghs
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Somewhere else I found this solution. It ain't pretty but it works (bye bye platform independence)
try{
String connName = ""; // fill out your connection name
String myUsername = ""; // fill out your username
String myPasswrd = ""; // fill out your password
Properties props = System.getProperties();
String osName = props.getProperty("os.name");
String command = "";

if(osName.equals("Windows Me")||osName.equals("Windows 98")||osName.equals("Windows 95")){
command = "start /wait C:\\Windows\\Rundll32.exe rnaui.dll,RnaDial ";
}

if(osName.equals("Windows NT")){
command = "RASDIAL.EXE ";
}
command = command + myConnName + myUsername + myPasswrd;
Process p = Runtime.getRuntime().exec(command);
p.waitFor();
}
catch (Exception e){
System.out.println(e.getMessage());
}
You can disconnect by calling rasdial /p.
Cheers,
-Ruud.
SCJP, SCJD ;-)
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic