解决方案 »
- if pbmfHeader^.bfType <> WORD(('M' shl 8) | 'B') then result:= nil;
- 现在学C#的人,主要用C#开发哪种类型的程序?
- 散分,婚假还没休完就被叫回公司
- 如何把数据集的字段加到TreeView的节点上
- 急出汗來,不知道怎麼解決?
- Fastreport问题!50分相送!
- 令我郁闷的问题!Error reading ktjypjfrm.Caption:
- 请大家帮帮我,在哪里可以下载Istallshield 5.1 ???????
- 我用ADODataSet进行存储数据的时候在它的afterpost事件中查询刚填进去的记录差不到,为什么,如何解决?
- 如何将webbrowser页面的内容保存为HTML文件?
- 请教Inno_Setup打包程序怎么执行sql脚本生成数据库?
- 获取RGB问题
Client := Clients.Items[Index];
TIdPeerThread(Client.Thread).Connection.WriteLn(Msg);
不知道行不行?
BroadcastMessage
procedure TfrmMain.BroadcastMessage( WhoFrom, TheMessage : String );
var
Count: Integer;
List : TList;
EMote,
Msg : String;
begin
Msg := Trim(TheMessage); EMote := Trim(memEMotes.Lines.Values[Msg]); if WhoFrom <> 'System' then
Msg := WhoFrom + ': ' + Msg; if EMote <> '' then
Msg := Format(Trim(EMote), [WhoFrom]); List := tcpServer.Threads.LockList;
try
for Count := 0 to List.Count -1 do
try
TIdPeerThread(List.Items[Count]).Connection.WriteLn(Msg);
except
TIdPeerThread(List.Items[Count]).Stop;
end;
finally
tcpServer.Threads.UnlockList;
end;
end;
try
for Count := 0 to List.Count -1 do
try
TIdPeerThread(List.Items[Count]).Connection.WriteLn(Msg);
except
TIdPeerThread(List.Items[Count]).Stop;
end;
finally
tcpServer.Threads.UnlockList;
end;这一段是向所有的链接发送信息。