Cannot Read File From Applet

I have read text files from applications numorous times but when I try to do that in applets it says access denied. I tried using scanner and DataInputStream and I had the same problem both times. Heres My code...

publicclass Readextends Applet

{

publicvoid init()

{

readFile();

}

publicvoid readFile()

{

String path="C:/file.txt";

try

{

DataInputStream in =new DataInputStream(new FileInputStream(path));

while (in.readLine()!=null)//Loop Till It Gets Through All The Lines

{

String readInput = in.readLine();

StringTokenizer tok =new StringTokenizer(readInput);

System.out.println(tok);

}

in.close();

}

catch(Exception e)

{

System.out.println(e);

}

}

publicvoid paint(Graphics g)

{

g.drawString("Welcome to Java!!", 50, 60 );

}

[1873 byte] By [concorde18a] at [2007-11-26 19:33:32]
# 1
I suppose you didn't sign the applet?
DrClapa at 2007-7-9 22:06:04 > top of Java-index,Java Essentials,Java Programming...
# 2
Applets are not allowed to read from the local file system or to open network connections other than to the host that served them, unless they are signed and the end-user trusts the signature.
jverda at 2007-7-9 22:06:04 > top of Java-index,Java Essentials,Java Programming...
# 3
Ok how can i sign it then? Thanks
concorde18a at 2007-7-9 22:06:04 > top of Java-index,Java Essentials,Java Programming...
# 4
http://www.google.com/search?hl=en&q=how+to+sign+a+java+applet&btnG=Search
jverda at 2007-7-9 22:06:04 > top of Java-index,Java Essentials,Java Programming...
# 5
Ah **** thats a total pain in the a**. Is there any other way to do this? By the time i figure this **** out ill be old.
concorde18a at 2007-7-9 22:06:04 > top of Java-index,Java Essentials,Java Programming...
# 6

> Ah **** thats a total pain in the a**. Is there any

> other way to do this?

Do what?

Get an applet to access a local file? No.

Accomplish whatever you're trying to do by having the applet access a local file, by some other non-applet-local-file means? Possibly. Depends on what your actual business requirments are.

jverda at 2007-7-9 22:06:04 > top of Java-index,Java Essentials,Java Programming...
# 7
> Accomplish whatever you're trying to do by having the> applet access a local file, by some other> non-applet-local-file means? Possibly. Depends on> what your actual business requirments are.Hackers have a way to get around everything.
qUesT_foR_knOwLeDgea at 2007-7-9 22:06:04 > top of Java-index,Java Essentials,Java Programming...
# 8
@OP an unsigned applet is run in the sandbox, where it is provided with only the minimum of resources to carry out it's task. The reason why it works this way is to prevent possible misuse of the resources of the host by malicious applets.
qUesT_foR_knOwLeDgea at 2007-7-9 22:06:04 > top of Java-index,Java Essentials,Java Programming...