![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Dec 2006
Posts: 13
Rep Power: 0
![]() |
accepting user input
Hi all, i've this code below which prompts a user to select from a list of ip addresses.e.g 192.168.2.1....etc. Now i wona modify this code so that if the machine on which the program is run has a different network part (192.168.2.) then I can prompt the user to enter their network ID e.g (148.145.23.) then increment the last bit using a for loop. Anyone able to help me out pls? thanks in advance
I have added this block of code below in order to do this but it doesnt work:
System.out.print("Enter your network part or hit enter to proceed: ");
String network = in.readString();
//test
System.out.println(network);
//if enter is pressed - same network
if (network == null)
{
System.out.print("SELECT A MACHINE TO VIEW FROM LIST: ");
int choice = in.readInteger();
}
else
{
//pass new network part to ip string variable
ip = network;
}nb: this code is part of my previous post on ' passing a string to a variable.....' click here to view full code:http://www.programmingforums.org/for...-variable.html any help appreciated. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| User input | jayme | C++ | 38 | Nov 25th, 2005 8:27 PM |
| FiveDigit + RandomeNumber Game. | TecBrain | Java | 0 | Nov 18th, 2005 3:53 PM |
| User Input for Number Format | ericelysia1 | Java | 0 | Jul 21st, 2005 4:41 PM |
| Problem read'ing from file and user input | jmsilver | Bash / Shell Scripting | 3 | May 20th, 2005 3:35 PM |
| Instant Messaging App Help | AusTex | C | 0 | Apr 27th, 2005 5:52 PM |