我使用Indy的TIdHTTP 向亚马逊的SES服务发布了问题.
这是我正在使用的代码示例:
procedure TMainFrm.btnAmazonSESClick(Sender: TObject);
var
SSLHandler: TIdSSLIOHandlerSocket;
HttpClient: TIdHTTP;
Params: TStringStream;
begin
SSLHandler := TIdSSLIOHandlerSocket.Create(Self);
HttpClient := TIdHTTP.Create(Self);
Params := TStringStream.create('');
try
with SSLHandler do
SSLOptions.Method := sslvSSLv3
with HttpClient do
begin
IOHandler := SSLHandler;
AllowCookies := True;
HandleRedirects := True;
HTTPOptions := [hoForceEncodeParams];
Request.ContentType := 'application/x-www-form-urlencoded';
end;
PageMemo.Text := HttpClient.Post('https://email.us-east-1.amazonaws.com?Action=VerifyEmailAddress&AWSAccessKeyId=012Some123Key46&EmailAddress=test@test%2Ecom', Params);
finally
SSLHandler.Free;
HttpClient.Free;
Params.Free;
end;
end;
Run Code Online (Sandbox Code Playgroud)
结果
在Indy 10.5.7下我收到错误:HTTP/1.1 404 Not Found
在Indy 9.0.14下我得到错误:套接字错误#11004
调试试验
同样的演示可以从HTTPS网页成功获取HTML.
如果我将上面的URL粘贴到浏览器中,它会显示预期的XML结果.
我很感激有关这个事业的任何建议.
好的,这是用图像最好解释的东西......

我正在寻找一个类似于StretchBlt的功能,但是我可以将图像复制到定义目标四个角的画布,即图像的梯形/四边形拉伸绘制到画布上.
我可以想到一些缓慢的方法来做到这一点,但我想知道是否存在与StretchBlt相似的速度(例如,速度不会慢十倍).
谢谢
环境:德尔福2007
<理由>我倾向于经常使用复杂的记录,因为它们几乎提供了类的所有优点,但处理起来更简单.</ Justification>
Anyhoo,我刚刚实现的一个特别复杂的记录是垃圾内存(后来导致"无效的指针操作"错误).
这是内存垃圾代码的一个例子:
sSignature := gProfiles.Profile[_stPrimary].Signature.Formatted(True);
Run Code Online (Sandbox Code Playgroud)
在我第二次调用它时,我得到"无效的指针操作"
如果我这样称呼它可以正常工作:
AProfile := gProfiles.Profile[_stPrimary];
ASignature := AProfile.Signature;
sSignature := ASignature.Formatted(True);
Run Code Online (Sandbox Code Playgroud)
背景代码:
gProfiles: TProfiles;
TProfiles = Record
private
FPrimaryProfileID: Integer;
FCachedProfile: TProfile;
...
public
< much code removed >
property Profile[ProfileType: TProfileType]: TProfile Read GetProfile;
end;
function TProfiles.GetProfile(ProfileType: TProfileType): TProfile;
begin
case ProfileType of
_stPrimary : Result := ProfileByID(FPrimaryProfileID);
...
end;
end;
function TProfiles.ProfileByID(iID: Integer): TProfile;
begin
<snip>
if LoadProfileOfID(iID, FCachedProfile) then
begin
Result := FCachedProfile;
end
else
...
end;
TProfile = …Run Code Online (Sandbox Code Playgroud) 我一直在使用Peter Below的APIClipboard单元多年,但它不再适用于Unicode Delphi.
ClipboardAsString返回gobbledegook:
Procedure DataFromClipboard( fmt: DWORD; S: TStream );
Var
hMem: THandle;
pMem: Pointer;
datasize: DWORD;
Begin { DataFromClipboard }
Assert( Assigned( S ));
hMem := GetClipboardData( fmt );
If hMem <> 0 Then Begin
datasize := GlobalSize( hMem );
If datasize > 0 Then Begin
pMem := GlobalLock( hMem );
If pMem = Nil Then
raise EclipboardError.Create( eLockFailed );
try
S.WriteBuffer( pMem^, datasize );
finally
GlobalUnlock( hMem );
end;
End;
End;
End;
Procedure CopyDataFromClipboard( fmt: DWORD; S: …Run Code Online (Sandbox Code Playgroud)