开发者

Can anyone give example of using sockets to send file?

I need to create two programs:

  1. Server
  2. Client

The server sends request to client, then the client receives request and captures the screen using this function:

function GetScreenShot(PixelFormat:TPixelFormat;Width,Height:Integer): TBitmap;
var
  Desktop: HDC;
begin
  Result  := TBitmap.Create;
  Desktop := GetDC(GetDesktopWindow);
  try
    try
      Result.PixelFormat := PixelFormat;
      Result.Width := Width;
      Result.Height := Height;
      BitBlt(Result.Canvas.Handle, 0, 0, Result.Width, Result.Height, Desktop, 0, 0, SRCCOPY);
      Result.Modified := True;
    finally
      ReleaseDC(0, Desktop);
    end;
  开发者_开发知识库except
    Result.Free;
    Result := nil;
  end;
end;

After that client sends bitmap to server.

Can someone help me?


Edited to add:

I have some examples:

  • This works
  • This works too
  • C++ and Delphi


have you tried this example http://delphi.about.com/od/internetintranet/l/aa012004a.htm ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜