小编Lit*_*per的帖子

如何在本地为多用户应用程序存储密码?

我想创建一个多用户应用程序,但我不知道如何保存和读取加密密码.

procedure SavePass(Password: WideString);
var
  Pass: TIniFile;
begin
  Pass := TIniFile.Create(ChangeFileExt(Application.ExeName, '.PASS'));
  Pass.WriteString('Users', 'USERNAME', Password);
  Pass.Free;
Run Code Online (Sandbox Code Playgroud)

密码必须存储在计算机上.这有效,但使用它来保存密码是愚蠢的.散列密码也很好.

delphi passwords delphi-7

4
推荐指数
1
解决办法
2819
查看次数

如何在组件调色板页面中将我的图标添加到组件?

可能重复:
delphi非可视组件图像

如何在组件调色板页面中将我的图标添加到我创建的组件中?

delphi delphi-7

3
推荐指数
1
解决办法
8899
查看次数

收集所有活动的窗口类名称

许多程序(True Transparancy和其他程序)都可以在后台窗口类名中运行或运行,如下所示:

Delphi 7 Object Inspector名称是tpropertyinspector
Opera主窗口类名operawindowclass
等.

那么如何在Delphi中获取任何打开的窗口类名?

windows delphi winapi window delphi-7

3
推荐指数
1
解决办法
2652
查看次数

如何禁用PNG的透明度

如何完全禁用给定的透明度PNGObject?顺便说一下,我正在使用版本1.564的PNGImage单元.

delphi png transparency delphi-7

3
推荐指数
1
解决办法
1349
查看次数

将两个字节组合到WideChar

是否有可能两者结合BytesWideChar,如果是,那么如何?
例如,二进制中的字母"ē"是00010011= 1900000001= 1,或者275在一起.

var
  WChar: WideChar;
begin
  WChar := WideChar(275); // Result is "?"
Run Code Online (Sandbox Code Playgroud)


var
  B1, B2: Byte;
  WChar: WideChar;
begin
  B1 := 19;
  B2 := 1;
  WChar := CombineBytesToWideChar(B1, B2); // ???
Run Code Online (Sandbox Code Playgroud)

如何WideChar从Delphi中的两个字节获取?

delphi delphi-7 unicode-string multibyte-functions widechar

3
推荐指数
1
解决办法
791
查看次数

问题是在时间上发送超过2行

我有套接字问题.
如果我发送超过两行文本TClientSocket然后服务器收到一行而不是两行.

客户部分:

ClientSocket1.Socket.SendText(Edit1.Text);//Text is 'Line1'
ClientSocket1.Socket.SendText(Edit2.Text);//Text is 'Line2'  
Run Code Online (Sandbox Code Playgroud)

服务器部分:

var
s: String;
begin
s := Socket.ReceiveText;
Memo1.Lines.Add(S);
Run Code Online (Sandbox Code Playgroud)

Memo1创建的行是'Line1Line2'
为什么?
对不起我的英语不好!

sockets delphi winsock delphi-7

2
推荐指数
2
解决办法
765
查看次数

如何避免显示错误?

如何避免显示小Windows错误框的错误?
Try并且Except不工作,因为错误不是由Delphi显示,而是来自程序或我认为来自Windows.
在此输入图像描述
try
Size:=TFileStream.Create(BitFile,fmOpenRead);
except on E: EFCreateError
do EC.Add('Error: ' + IntToStr(GetLastError));
end;

delphi error-handling delphi-7

2
推荐指数
1
解决办法
1260
查看次数

Delphi - 绘制文本,以便在重新绘制其下的图像后不会消失

我应该如何在画布上绘制文本,以便在重新绘制/更新/刷新后不会一次又一次地重新绘制文本时文本不会消失?就像它被画成图像而不是暂时画的.

delphi canvas paint delphi-7

2
推荐指数
1
解决办法
1966
查看次数

在其他PNG上绘制PNG图像

如何将两个PNG合并在一起?我知道你不能使用,PNGObject.Draw因为它不会复制alpha transaperncy(我不确定,但它无论如何都不起作用)所以需要自定义过程/功能.我没有空手来,我有这个程序:

procedure MergePNGLayer(Layer1,Layer2: TPNGObject; Const aLeft,aTop:Integer);
var
  x, y: Integer;
  SL1,  SL2,  SLBlended : pRGBLine;
  aSL1, aSL2, aSLBlended: PByteArray;
  blendCoeff: single;
  blendedPNG, Lay2buff: TPNGObject;
begin
  blendedPNG:=TPNGObject.Create;
  blendedPNG.Assign(Layer1);
  Lay2buff:=TPNGObject.Create;
  Lay2buff.Assign(Layer2);
  SetPNGCanvasSize(Layer2,Layer1.Width,Layer1.Height,aLeft,aTop);
  for y := 0 to Layer1.Height-1 do
  begin
    SL1 := Layer1.Scanline[y];
    SL2 := Layer2.Scanline[y];
    aSL1 := Layer1.AlphaScanline[y];
    aSL2 := Layer2.AlphaScanline[y];
    SLBlended := blendedPNG.Scanline[y];
    aSLBlended := blendedPNG.AlphaScanline[y];
    for x := 0 to Layer1.Width-1 do
    begin
      blendCoeff:=aSL1[x] * 100/255/100;
      aSLBlended[x] := round(aSL2[x] + (aSL1[x]-aSL2[x]) * blendCoeff);
      SLBlended[x].rgbtRed …
Run Code Online (Sandbox Code Playgroud)

delphi merge png delphi-7 scanline

2
推荐指数
1
解决办法
2911
查看次数

用于ip扫描程序的多线程的关键部分

您好我对关键部分有疑问.我有两个线程scannerThread和scannerchild thread.Code for Scannerthread如下所述.

procedure ScannerThread.Execute;
var
  I: Integer;
  ScannerCh: Array of ScannerChild;
  IpList: TStringlist;
  IPCount: Integer;
begin
  IpList:=TStringList.Create;
  IF GetNumberOfIpsInRange(Ip_From, Ip_To, IpList) then // Function call that returns iplist if TRUE
  begin
    Try
      if Assigned(LvHosts) then // Clear
        LvHosts.Clear;
      IPCount := IpList.Count;
      SetLength(ScannerCh, IPCount);
        I := 0;
        repeat
          while GetTThreadsCount(GetCurrentProcessId) > tcount do // Tcount is threads to create which is given by user     
            Sleep(10);
          ScannerCh[I]:=ScannerChild.Create(True, IpList[i]);
          ScannerCh[I].FreeOnTerminate := True;
          ScannerCh[I].LvHostname := LvHosts;
          ScannerCh[I].Resume;
          Inc(I);
        until I = IPCount; …
Run Code Online (Sandbox Code Playgroud)

delphi multithreading synchronization delphi-7 critical-section

1
推荐指数
1
解决办法
694
查看次数