Solved

Directories Files

Posted on 1998-07-08
3
187 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exception after setting jdbc session management 2 52
what is the difference between "sudo su" and "su - root" 6 104
JAVA part two 5 57
java jdbc batch example 8 21
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

911 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now