You will first need to read the files content. Then you could use a regular expression that matches the ip address (e.g. \d+\.\d+\.\d+\.\d+) and replace it with the new one. When you've done that write it back in the file again.
Here is a regex tester: http://www.regexplanet.com/advanced/java/index.html
Here a tutorial of how to read and write files: http://www.java-samples.com/showtutorial.php?tutorialid=392
ليست هناك تعليقات:
إرسال تعليق