根據this answer,Java 7具有操縱Windows元數據的本機功能,但Java 6不具備這一功能。
它的確表示您可以使用Java Native Access(JNA)調用本機DLL,這意味着您應該可以使用dsofile.dll來操作元數據。從使用JNA從MSVCRT.DLL訪問 「放」 功能的實施例here(找不到特定於dsofile.dll任何實施例):
接口
package CInterface;
import com.sun.jna.Library;
public interface CInterface extends Library
{
public int puts(String str);
}
Sample類
// JNA Demo. Scriptol.com
package CInterface;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Platform;
public class hello
{
public static void main(String[] args)
{
String mytext = "Hello World!";
if (args.length != 1)
{
System.err.println("You can enter your own text between quotes...");
System.err.println("Syntax: java -jar /jna/dist/demo.jar \"myowntext\"");
}
else
mytext = args[0];
// Library is c for unix and msvcrt for windows
String libName = "c";
if (System.getProperty("os.name").contains("Windows"))
{
libName = "msvcrt";
}
// Loading dynamically the library
CInterface demo = (CInterface) Native.loadLibrary(libName, CInterface.class);
demo.puts(mytext);
}
}
你問什麼類型的文件? –
你好rhsatrhs。任何類型的附件,如Office文件,CAD,EXE,RAR和Zip文件等等。有時Zip和RAR文件被分割成幾個文件... –