Solved

Directories Files

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 214
expectj telnet failing 5 45
JavaFX TableView not displaying correctly 3 60
How  can  i  resolve  HTTP Status 404 -? 8 46
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

820 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