Solved

Directories Files

Posted on 1998-07-08
3
213 Views
Last Modified: 2010-03-30
Simply Put
I Need Complete Code To:
Get Users IP
Read A Directory Listing Of ./tmp Into A Array.
Check To See If IP Matches File Name...
If Yes Alert "No".(I Have Code To Replace This)
If No Create Empty FIle Named IP In ./tmp & Alert "Yes". (I Have Code To Replace This Too).
Upon Exit Delete IP File Name From ./tmp
txs
0
Comment
Question by:refr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Expert Comment

by:drasin
ID: 1225389
Are you referring to the /tmp directory on the server  from which the applet was generated, or the machiene on which the applet is running?
0
 

Author Comment

by:refr
ID: 1225390
Sorry On The Server Side.
0
 
LVL 2

Accepted Solution

by:
threshold earned 120 total points
ID: 1225391
The Request is from an Applet and you want to access files on Server...
I think You need a Server Application (ie. CGI) to do this.
You applet need to open a Socket to Server that contains your Applet, and applet sends request, then Server Application receive request and access files on Server.
There are many ways to communicate with server:

(1) HTTP: You need a CGI on the Web Server to receive the Request from the Applet
      in Applet:
          URL url1=new URL("xxx.asp?myname="+name);
          DataInputStream dis=new DataInputStream(url1.openStream());
      in CGI (if you have IIS + ASP, it will be very simple):
          1. use 'Request.QueryString("myname") to receive the data
          2. use the Scripting.FileSystem to create file

(2) Create an application on Server. it opens a Server Socket to receive any request from Client and do anything.
      And, Applet opens socket to communicate with Server.

(3) RMI , You can write the Server Application with simple programing in Java.

0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question