结果:

GetTempFileName:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/tmp/tmp.iQIip24407

GetTempPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/tmp

GetHomePath:/data/data/com.embarcadero.Project1/files

GetDocumentsPath:/data/data/com.embarcadero.Project1/files

GetSharedDocumentsPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files

GetLibraryPath:/data/data/com.embarcadero.Project1/lib

GetCachePath:/data/data/com.embarcadero.Project1/cache

GetPathRoot:/

GetPublicPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files

GetPicturesPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/Pictures

GetSharedPicturesPath:/storage/sdcard0/Pictures

GetCameraPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/DCIM

GetSharedCameraPath:/storage/sdcard0/DCIM

GetMusicPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/Music

GetSharedMusicPath:/storage/sdcard0/Music

GetMoviesPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/Movies

GetAlarmsPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/Alarms

GetSharedAlarmsPath:/storage/sdcard0/Alarms

GetDownloadsPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/Download

GetSharedDownloadsPath:/storage/sdcard0/Download

GetRingtonesPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/Ringtones

GetSharedRingtonesPath:/storage/sdcard0/Ringtones

 unit Unit1;

 interface

 uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.ScrollBox,
FMX.Memo, FMX.Controls.Presentation, FMX.StdCtrls; type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; var
Form1: TForm1; implementation
uses
System.IoUtils;
{$R *.fmx}
{$R *.NmXhdpiPh.fmx ANDROID} 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; procedure TForm1.Button2Click(Sender: TObject);
begin
if TFile.Exists(TPath.GetTempFileName) then
begin
Memo1.Lines.Clear;
Memo1.Lines.Add('存在');
end;
end; procedure TForm1.Button3Click(Sender: TObject);
begin
if not TDirectory.Exists(TPath.GetTempPath + 'NewDirectory') then
TDirectory.CreateDirectory(TPath.GetTempPath + 'NewDirectory');
end; procedure TForm1.Button4Click(Sender: TObject);
var
sFile1: string;
sFile2: string;
begin
sFile1 := TPath.GetTempPath + '123.jpg';
sFile2 := TPath.GetTempPath + '456.jpg';
if not TFile.Exists(sFile1) then
begin
TFile.Copy(sFile1, sFile2);
end;
end; procedure TForm1.Button5Click(Sender: TObject);
var
Files: TStringDynArray;
I: Integer;
begin
if TDirectory.Exists(TPath.GetTempPath + '/temp/') then
begin
Files := TDirectory.GetFiles(TPath.GetTempPath + '/temp/');
for I := to high(Files) do
begin
TFile.Delete(Files[I]);
end;
end;
end; end.

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

  1. Android实例-使用电话拨号器在移动设备上(官方)(XE8+小米2)

    源文地址: http://docwiki.embarcadero.com/RADStudio/XE5/en/Mobile_Tutorial:_Using_the_Phone_Dialer_on_Mob ...

  2. Android的路径信息[转]

    Delphi早就把IO相关的都提取到System.IoUtils单元中了. 路径操作就使用TPath的方法都很方便.usesSystem.IoUtilsTPath.GetTempPath//临时目录T ...

  3. Delphi处理Android的路径信息

    路径操作就使用TPath的方法都很方便.usesSystem.IoUtilsTPath.GetTempPath//临时目录TPath.GetCameraPath//照相机目录(照片/录像)TPath. ...

  4. matlab 重命名文件和文件夹

    1.查看文件存在  dir() 若存在,返回文件信息      dir(‘test.txt’) %查看当前目录是否存在test.txt文件 dir(‘C:\test.txt’) %查看指定目录是否存在 ...

  5. Android根据文件路径使用File类获取文件相关信息

    Android通过文件路径如何得到文件相关信息,如 文件名称,文件大小,创建时间,文件的相对路径,文件的绝对路径等: 如图: 代码: public class MainActivity extends ...

  6. C# 对包含文件或目录路径信息的 System.String 实例执行操作

    在字符串操作中有一类比较特殊的操作,就是对包含文件或目录路径信息的 System.String 实例执行操作.比如根据一个表示路径的字符串获取其代表的文件名称.文件夹路径.文件扩展名等.在很多时候,我 ...

  7. android--------根据文件路径使用File类获取文件相关信息

    Android通过文件路径如何得到文件相关信息,如 文件名称,文件大小,创建时间,文件的相对路径,文件的绝对路径等. 如图: public class MainActivity extends Act ...

  8. 使用任意的输入流(InputStream)实例,包括字符串形式的文件路径或者 file:// 的 URL 形式的文件路径来配置

    mybatis – MyBatis 3 | 入门 http://www.mybatis.org/mybatis-3/zh/getting-started.html 从 XML 中构建 SqlSessi ...

  9. Android学习路径(两)项目文件本身使用场景和文件演示

    ios讨论群1群:135718460  1.src文件:java源码存放文件夹 2.gen 文件:自己主动生成全部由android开发工具自己主动生成的文件,文件夹中最重要的就是R.java文件,这个 ...

随机推荐

  1. xcode 树形管理 cocos2d-x的资源

    把资源以目录的形式加入xcode中, 同时, 在加入时, 选择"Create Folder References for any  added folders", 而不是默认的&q ...

  2. QT UAC问题汇总贴

    http://www.qtcn.org/bbs/read-htm-tid-47983.html http://www.cnblogs.com/bombless/archive/2010/12/29/h ...

  3. javascript高级程序设计读书笔记

    第2章  在html中使用javascript 一般都会把js引用文件放在</body>前面,而不是放在<head>里, 目的是最后读取js文件以提高网页载入速度. 引用js文 ...

  4. DX 绘制位图

    简单地学习了四个API: HRESULT CreateOffscreenPlainSurface( [in] UINT Width, // 宽度 [in] UINT Height, // 高度 [in ...

  5. ScrollView can host only one direct child 解决

    主要是ScrollView内部只能有一个子元素,即不能并列两个子元素,所以需要把所有的子元素放到一个LinearLayout内部或RelativeLayout等其他布局方式让后再在这个layout外部 ...

  6. 【转】五种开源协议的比较(BSD, Apache, GPL, LGPL, MIT)

    当 Adobe.Microsoft.Sun 等一系列巨头开始表现出对”开源”的青睐时,”开源”的时代即将到来! 现今存在的开源协议很多,而经过 Open Source Initiative 组织通过批 ...

  7. Flash Media Server 5.0 (FMS)注册码

    flash media server 4.5 及最新 flash media server 5.0 注册码 防止图片打不开时: Name:tam/CORE Serial:1652-5580-8001- ...

  8. 【HDOJ】4605 Magic Ball Game

    思路1:树状数组+离线处理,对所有的w离散化处理,边dfs边使用树状数组更新左右w的情况.思路2:主席树,边bfs边建树.结点信息存储cnt,然后在线查询.树状数组. /* 4605 */ #incl ...

  9. Java [leetcode 28]Implement strStr()

    题目描述: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if ...

  10. java.lang.Thread.State类详解

    public static enum Thread.Stateextends Enum<Thread.State>线程状态.线程可以处于下列状态之一: 1.NEW 至今尚未启动的线程的状态 ...