This page is part of the project " Learning of English by Speaking ( ELS )", which is funded by the European Union. This is project is co-financed by the Fonds National de la Recherche Scientifique ( FNRS ), Belgium.Q:
How to get the path of the file which is being opened from main method in java
i m using following code for my project and i want to print the path of the file which is being opened from the code
and i am able to print the package but
it is giving the folder name and not the path
package y.class;
import java.io.File;
public class Package {
public static void main(String[] args) {
try {
File f = new File("C:\Test.pdf");
File file = new File("C:\Test.pdf");
String s = file.getPath();
System.out.println(s);
} catch (Exception e) {
System.out.println(e);
}
}
}
A:
You can use Java Path API like below:
String fileName = "test.txt";
File file = new File(fileName);
String path = file.getPath();
Hope it will work for you.
Q:
How can I pass parameters from JavaScript to an iFrame?
I have a simple program, that basically just links to a web page with an iframe and inserts some text into that iframe. What I would like to know is how can I pass an ID, a URL and a Name from JavaScript to the iframe?
I'm using ASP.NET and the iFrame is an ASP control.
A:
You can use Window.top.document.getElementById() to access the iframe from JavaScript, then set its source property with whatever you like.
Example:
var iframe = Window.top.document.getElementById('someId');
iframe.src = '';
'use strict';
import { k8s } from './v ac619d1d87
Related links:
コメント