我想问局域网中联网的电脑10.1.1.10 c盘下test.txt
C盘的共享名为 C$.File f = new File("file:///10.1.1.10/C$/test.txt"),不行File f = new File(new URI("file:///10.1.1.10/C$/test.txt")),不行File f = new File("\\\\10.1.1.10\\C$\\test.txt"),不行File f = new File("File:\\\\10.1.1.10\\C$\\test.txt"),不行那怎样才行呢?多谢各位!
C盘的共享名为 C$.File f = new File("file:///10.1.1.10/C$/test.txt"),不行File f = new File(new URI("file:///10.1.1.10/C$/test.txt")),不行File f = new File("\\\\10.1.1.10\\C$\\test.txt"),不行File f = new File("File:\\\\10.1.1.10\\C$\\test.txt"),不行那怎样才行呢?多谢各位!
解决方案 »
- 关于RandomFile的 请各位帮帮忙
- 帮忙看一下Timer、TimerTask
- java 动态命名问题
- 征求排序算法,分不够可以加哦!
- 关于异常的问题????
- 怎么会这样了!dereference是什么错误???
- 为啥不能画???不用APPLET, 我想在Frame窗口应用程序下怎么画
- 求助,用java读入图片,转换成黑白,在图片中放入密码,转换成其它模糊图片,再把图像模糊处理.
- 我是JAVA的初学者,以前是搞VB和ASP开发的,我有个问题想问问大家。
- 一个不用odbc 联sqlserver 2k的小问题,解决马上给分
- 请帮忙 !!servlet中用jxl生成excel出现的问题,
- 请教关于JCreate中编译servlet问题!
File file = new File("\\\\192.168.1.104\\aa\\a.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
String s = null;
while ((s = br.readLine()) != null) {
System.out.println(s);
}
}
其中aa为你的共享文件夹名。
如我的文件放在c:\\aa文件夹下。
文件名为a.txt
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
String sLine = null;
while ((sLine = br.readLine()) != null) {
System.out.println(sLine);
}出力结果:
1,2,3,4
2,
3,
(就是我的1.txt里面的内容)测试环境:
Win2000 Pro
Eclipse 2.1.2
JDK 1.4.2_08