Write to a file under program files directory in vista
Hi,
How can i write a file under program files directory in vista? It seems like that there is a permission problem. The following code does nothing and also i don't get any error messages.
Thanks in advance.
publicvoid test(){
try{
String myFile ="C:/Program Files/AnyApp/test.txt";
FileWriter fw =new FileWriter(myFile,true);
BufferedWriter writer =new BufferedWriter(fw);
for (int i = 0; i < 10; i++){
writer.append("test");
}
writer.flush();
writer.close();
}catch (Exception e){
e.printStackTrace();
}
}

