Android实例-路径信息及文件和文件夹的操作(XE8+小米2)

procedure TForm1.Button1Click(Sender: TObject);
begin
  Memo1.Lines.Clear;
  Memo1.Lines.Add('GetTempFileName:' + TPath.GetTempFileName);
  Memo1.Lines.Add('GetTempPath:' + TPath.GetTempPath);
  Memo1.Lines.Add('GetHomePath:' + TPath.GetHomePath);
  Memo1.Lines.Add('GetDocumentsPath:' + TPath.GetDocumentsPath);
  Memo1.Lines.Add('GetSharedDocumentsPath:' + TPath.GetSharedDocumentsPath);
  Memo1.Lines.Add('GetLibraryPath:' + TPath.GetLibraryPath);
  Memo1.Lines.Add('GetCachePath:' + TPath.GetCachePath);
  Memo1.Lines.Add('GetPathRoot:' + TPath.GetPathRoot(TPath.GetCachePath));
  Memo1.Lines.Add('GetPublicPath:' + TPath.GetPublicPath);
  Memo1.Lines.Add('GetPicturesPath:' + TPath.GetPicturesPath);
  Memo1.Lines.Add('GetSharedPicturesPath:' + TPath.GetSharedPicturesPath);
  Memo1.Lines.Add('GetCameraPath:' + TPath.GetCameraPath);
  Memo1.Lines.Add('GetSharedCameraPath:' + TPath.GetSharedCameraPath);
  Memo1.Lines.Add('GetMusicPath:' + TPath.GetMusicPath);
  Memo1.Lines.Add('GetSharedMusicPath:' + TPath.GetSharedMusicPath);
  Memo1.Lines.Add('GetMoviesPath:' + TPath.GetMoviesPath);
  Memo1.Lines.Add('GetAlarmsPath:' + TPath.GetAlarmsPath);
  Memo1.Lines.Add('GetSharedAlarmsPath:' + TPath.GetSharedAlarmsPath);
  Memo1.Lines.Add('GetDownloadsPath:' + TPath.GetDownloadsPath);
  Memo1.Lines.Add('GetSharedDownloadsPath:' + TPath.GetSharedDownloadsPath);
  Memo1.Lines.Add('GetRingtonesPath:' + TPath.GetRingtonesPath);
  Memo1.Lines.Add('GetSharedRingtonesPath:' + TPath.GetSharedRingtonesPath);
end;

  全文:http://blog.csdn.net/yeeonefx/article/details/50585515 //完整代码。

据我所知,Delphi XE除了TPath类,还有TDirectory类,例如:http://blog.sina.com.cn/s/blog_549f50ec01019q76.html

还有Environment类获取外部存储目录,即/mnt/sdcard目录,详情:http://blog.csdn.net/daniel80110_1020/article/details/55504833

posted @ 2017-08-23 13:46  stma  阅读(149)  评论(0编辑  收藏  举报