String writeEnc = "SJIS";
String path = "f:\\creat.xml" ;
BufferedWriter file = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( path ),writeEnc ) );为什么我这样写提示:
访问被拒绝了。
这个错误呢?
我想在指定盘符生成一个文件
谢谢了
String path = "f:\\creat.xml" ;
BufferedWriter file = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( path ),writeEnc ) );为什么我这样写提示:
访问被拒绝了。
这个错误呢?
我想在指定盘符生成一个文件
谢谢了
import java.io.FileNotFoundException;
import java.io.FileOutputStream;public class test_call { /**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String writeEnc = "SJIS.txt";
String path = "E:/";
File aFile = new File(path, writeEnc);
FileOutputStream outputFile = null;
try {
outputFile = new FileOutputStream(aFile, true);
} catch (FileNotFoundException e) {
e.printStackTrace(System.err);
System.exit(1);
}
}
}
{
String writeEnc = "SJIS";
String path = "c:\\creat.xml" ;
BufferedWriter file = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( path ),writeEnc ) ); }catch(Exception e){}