好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

获取绝对路径

Use Platform.script to get the absolute URI of the script being run in the current isolate.

 import 'dart:io' show Platform;

main() {
  // Get the URI of the script being run.
  var uri = Platform.script;
  print(uri); // Prints something like '/Users/shailentuli/workspace/...'.

  // Convert the URI to a path.
  var path = uri.toFilePath();
  print(
      path); // Prints something like 'file:///Users/shailentuli/workspace/...'.
} 

查看更多关于获取绝对路径的详细内容...

  阅读:63次