现在我像这样张贴一张照片到墙上:
$response = $facebook->api("/$group_id/photos", "POST", array(
'access_token=' => $access_token,
'message' => 'This is a test message',
'url' => 'http://d24w6bsrhbeh9d.cloudfront.net/photo/agydwb6_460s.jpg',
)
);
Run Code Online (Sandbox Code Playgroud)
它工作正常,但我可以以某种方式发布多张照片,如下所示:

提前致谢!
我有一个带有一维数组的 JSON 字段。事实上,在这个字段中我有一些 ID 的列表,如下所示:
[347470, 162063, 17315, 346852, 174776, 295865, 7833, 136813]
Run Code Online (Sandbox Code Playgroud)
在我的查询中,我这样引用该字段:
... AND JSON_CONTAINS(`users_actions`, 174776)=0
Run Code Online (Sandbox Code Playgroud)
我的问题是:我应该为此字段创建一个索引吗?如果是的话,我应该使用哪个索引?
我用来下载wininet的一些函数文件:
Url := source_file;
destinationfilename := destination_file;
hInet := InternetOpen(PChar(application.title), INTERNET_OPEN_TYPE_PRECONFIG,
nil, nil, 0);
hFile := InternetOpenURL(hInet, PChar(Url), nil, 0,
INTERNET_FLAG_NO_CACHE_WRITE, 0);
if Assigned(hFile) then
begin
AssignFile(localFile, destinationfilename);
Rewrite(localFile, 1);
repeat
InternetReadFile(hFile, @Buffer, SizeOf(Buffer), bytesRead);
BlockWrite(localFile, Buffer, bytesRead);
current_size := current_size + bytesRead;
until (bytesRead = 0) OR (terminated = True);
CloseFile(localFile);
InternetCloseHandle(hFile);
end;
InternetCloseHandle(hInet);
Run Code Online (Sandbox Code Playgroud)
我试图确定下载速度,但得到一些奇怪的值:
...
repeat
QueryPerformanceFrequency(iCounterPerSec);
QueryPerformanceCounter(T1);
InternetReadFile(hFile, @Buffer, SizeOf(Buffer), bytesRead);
BlockWrite(localFile, Buffer, bytesRead);
current_size := current_size + bytesRead;
QueryPerformanceCounter(T2);
_speed := round((bytesRead / 1024) / ((T2 …Run Code Online (Sandbox Code Playgroud) 我用这段代码下载小文件:
Var
ms:TMemoryStream;
begin
ms:=TMemoryStream.Create;
Idhttp1.get('http://mydomain.com/myfile.zip',ms);
ms.SaveToFile('myfile.zip');
ms.Free;
end;
Run Code Online (Sandbox Code Playgroud)
但是文件在存储到磁盘之前保存在RAM中,因此可能难以下载文件> 1Gb,例如.有没有办法按部件下载文件?或者我需要使用WinInet吗?提前致谢!
我有两个二进制文件(假设,这是一个以前分成两部分的ZIP文件).我如何将它们组合成一个文件?更准确地说,将第二个文件添加到第一个文件.
更新:伙计们,感谢所有回复我的人,但这并不是我需要的.基本上,我需要一个shell命令的模拟:"copy/b file.000 + file.001 + file.002 file.bin"
我有一个来自TThread的孩子.一切正常,但我怎么能大规模暂停或恢复我创建的线程?或者我怎么才能暂停第二个线程(在Button2Click中创建)?这是我的代码的一部分:
TMyThread = class(TThread)
private
source_file, destination_file: string;
total_size, current_size, download_item_id: integer;
protected
procedure ShowResult;
procedure Execute; override;
public
end;
var
MyThread: TMyThread;
begin
procedure TMyThread.Execute;
begin
//Some code for download file here, it doesn't matter
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
MyThread := TMyThread.Create(True);
MyThread.source_file :='http://example.com/download1.zip';
MyThread.destination_file := 'c:\download1.zip';
MyThread.download_item_id := 0;
MyThread.Priority := tpNormal;
MyThread.FreeOnTerminate := True;
MyThread.Resume;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
MyThread := TMyThread.Create(True);
MyThread.source_file :='http://example.com/download2.zip';
MyThread.destination_file := 'c:\download2.zip';
MyThread.download_item_id := 1;
MyThread.Priority := tpNormal;
MyThread.FreeOnTerminate := …Run Code Online (Sandbox Code Playgroud) 我需要执行以下操作:URL http://domain.com/view.php?show=my_article_name应该被重定向到http://domain.com/my_article_name/我该怎么做?提前致谢.