搬到新服务器后,我遇到了一个奇怪的问题.用于获取邮件的cron检查授权的IP,其中一个默认为127.0.0.1
它在移动后停止工作,因为未填充REMOTE_ADDR变量.它是从浏览器调用时,但不是从cron内部运行或从php运行控制台时.我转储了$ _SERVER变量,这是cron/console的全部内容
(
[SHELL] => /bin/sh
[MAILTO] => *removed*
[USER] => *removed*
[PATH] => /usr/bin:/bin
[PWD] => /home/*removed*
[SHLVL] => 1
[HOME] => /home/*removed*
[LOGNAME] => *removed*
[_] => /usr/local/bin/php
[PHP_SELF] => /home/*removed*/public_html/support/cron.php
[SCRIPT_NAME] => /home/*removed*/public_html/support/cron.php
[SCRIPT_FILENAME] => /home/*removed*/public_html/support/cron.php
[PATH_TRANSLATED] => /home/*removed*/public_html/support/cron.php
[DOCUMENT_ROOT] =>
[REQUEST_TIME] => 1300522141
[argv] => Array
(
[0] => /home/*removed*/public_html/support/cron.php
)
[argc] => 1
)
if(!$cron->isValidIp($_SERVER['REMOTE_ADDR'])) {
echo sprintf("[ERROR]: Your IP %s is not authorized to run scheduled tasks. Please notify your administrator.",
$_SERVER['REMOTE_ADDR']
); …Run Code Online (Sandbox Code Playgroud) 在XE2的64位平台上,这怎么会是正确的?
type
PRGB24 = ^TRGB24;
TRGB24 = packed record
B: Byte;
G: Byte;
R: Byte;
end;
var
s1: pRGB24;
ptrD: integer;
....
inc(Integer(s1), PtrD); <- gives error here "Left side cannot be assigned to"
Run Code Online (Sandbox Code Playgroud) 我稍微调整了这里的代码:
要按给定的pID返回句柄名称列表,我将每个条目添加到TStringList.问题是名称中包含垃圾"?" 在包含unicode字符的文件名中,例如"xxx★5"出现为"xxx?5"
代码有什么问题?
自从升级到XE6后,在使用样式时应用程序菜单中似乎存在一个错误,最好用这些屏幕截图解释:
第二个屏幕截图将"22"项目Visible设置为False


使用DCrypt在Delphi中使用此代码:
Uses DCPcrypt2, DCPblockciphers, DCPrijndael, DCPbase64;
procedure TForm1.Button1Click(Sender: TObject);
var Cipher : TDCP_rijndael;
ss, k, Data, Key, IV : Ansistring;
const
KeySize = 32; // 32 bytes = 256 bits
BlockSize = 16; // 16 bytes = 128 bits // IV
begin
key := '12345678901234567890123456789012';
iv := '1234567890123456';
Data := 'thisis128bitstxt';
Cipher := TDCP_rijndael.Create(nil);
Cipher.Init(Key[1],128,@IV[1]);
Cipher.EncryptCBC(Data[1],Data[1],Length(Data));
Cipher.Free;
Data := DCPBase64.Base64EncodeStr(Data);
Memo1.Lines.Add(Data);
end;
Run Code Online (Sandbox Code Playgroud)
我得到以下内容:Eq7iMlVKysMMXdhR0rtrwA ==
使用OpenSSL在PHP中尝试相同:
<?
$s = "thisis128bitstxt";
$s = openssl_encrypt($s, "AES-128-CBC", "12345678901234567890123456789012", 0, "1234567890123456");
echo $s . "</br>"; …Run Code Online (Sandbox Code Playgroud) 我可以获得一些代码,显示如何在右键单击上下文菜单上绘制位图/图标吗?
我已经为上下文菜单的DLL编写了代码,但它只是文本.示例:http://www.marcocantu.com/code/md5/TODOSHLL.htm
在vsicon模式下使用Delphi XE3,Listview并指定了imagelist.
我添加一些项目并为它们分配一个ImageIndex,每个图像/项目之间有一个非常大的间距/边距,我该如何改变它?没有定制绘图可以吗?
我的应用程序的一些用户有一个奇怪的问题,在启动时他们得到一个例外的datitimepickers,其预定的最小/最大日期设置为1950年1月1日 - 2050年12月31日.
应用程序抛出的默认错误消息是
"读取time1.Max时出错:无法设置日历最小/最大范围."
在嵌入调试器(madshi的madExcept)后,我在报告中看到:
"阅读时间错误1.MaxDate:'23:59:59'不是有效的日期和时间."
表单上的对象具有以下属性:
Run Code Online (Sandbox Code Playgroud)Date = 39773.494141041670000000 Format = 'MMM yyyy' Time = 39773.494141041670000000 MaxDate = 55153.999988425920000000 MinDate = 18264.000000000000000000
知道可能是什么问题吗?
崩溃数据:
主线程($ 2b08):
> 0051501b +0a7 app.exe System.Classes 10430 +5 HandleException
> 00515255 +1f5 app.exe System.Classes 10487 +48 TReader.ReadProperty
> 00514a65 +015 app.exe System.Classes 10233 +1 TReader.ReadDataInner
> 00514a47 +067 app.exe System.Classes 10226 +11 TReader.ReadData
> 0051de05 +001 app.exe System.Classes 15947 +0 TComponent.ReadState
> 0057d017 +02f app.exe Vcl.Controls 5567 +3 TControl.ReadState
> 00581481 +025 app.exe …Run Code Online (Sandbox Code Playgroud) 在 W7 x64 中使用 Delphi Seattle。使用自定义 VCL 样式并选择大量文件(如 2-3k+)时,文件名已损坏。如果没有自定义样式,这不会发生。
program Project1;
uses
Vcl.Forms,
Unit1 in 'Unit1.pas' {Form1},
Vcl.Themes,
Vcl.Styles;
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
TStyleManager.TrySetStyle('Onyx Blue');
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
procedure TForm1.FormCreate(Sender: TObject);
Var s: string;
ts: TStringList;
begin
if OpenDialog1.Execute then begin
ts := TStringList.Create;
for s in OpenDialog1.Files do
ts.Add(s);
end else Exit;
ts.SaveToFile('z:\files.txt');
ts.Free;
end;
object OpenDialog1: TOpenDialog
Filter = 'Pictures (jpg,png,bmp,gif)|*.jpg;*.png;*.bmp;*.gif|All Files|*.*'
Options = [ofReadOnly, ofAllowMultiSelect, ofEnableSizing, ofForceShowHidden]
Title = 'Select files to upload' …Run Code Online (Sandbox Code Playgroud) 作为线程的新手,我遇到了一个问题:
我为 Synapse THTTPSend 对象构建了一个小包装器,以通过线程处理异步调用。一切似乎都很顺利,直到我退出应用程序并收到此错误(使用 madExcept 异常处理程序)“系统错误。代码:1400。窗口句柄无效。”
main thread ($2d00):
0047f931 +091 x.exe System.SysUtils RaiseLastOSError
0047f88e +00e x.exe System.SysUtils RaiseLastOSError
006198c4 +064 x.exe Vcl.Controls TWinControl.DestroyWindowHandle
0061674c +0dc x.exe Vcl.Controls TWinControl.Destroy
0067487b +05b x.exe Vcl.ComCtrls TTabSheet.Destroy
00616781 +111 x.exe Vcl.Controls TWinControl.Destroy
00673218 +0b8 x.exe Vcl.ComCtrls TCustomTabControl.Destroy
0067529c +06c x.exe Vcl.ComCtrls TPageControl.Destroy
00616781 +111 x.exe Vcl.Controls TWinControl.Destroy
0073d95e +06e x.exe Vcl.Forms TScrollingWinControl.Destroy
0073f5d2 +1e2 x.exe Vcl.Forms TCustomForm.Destroy
0040b2d5 +015 x.exe System TObject.Free
005a034e +08e x.exe System.Classes TComponent.DestroyComponents
0073be06 +046 x.exe Vcl.Forms DoneApplication …Run Code Online (Sandbox Code Playgroud) delphi ×9
64-bit ×1
aes ×1
apache ×1
contextmenu ×1
cron ×1
delphi-xe2 ×1
delphi-xe3 ×1
delphi-xe6 ×1
encryption ×1
hosting ×1
listview ×1
openssl ×1
php ×1
shell ×1
vcl-styles ×1