>将该字串大写----->有个函数记不得了好象是CAP开头的吧。
》传回 NMStrm 给你一个UDP的例子吧用法和nmstrm差不多我就不改了。
procedure TForm1.Button1Click(Sender: TObject);
var
MyStream: TMemoryStream;
TmpStr: String;
Begin
NMUDP1.ReportLevel := Status_Basic;
NMUDP1.RemoteHost := Edit1.Text;
NMUDP1.RemotePort := StrToInt(Edit2.Text);
TmpStr := Edit3.Text;
MyStream := TMemoryStream.Create;
try
MyStream.Write(TmpStr[1], Length(Edit3.Text));
NMUDP1.SendStream(MyStream);
finally
MyStream.Free;
end;
end;
procedure TForm1.NMUDP1DataReceived(Sender: TComponent;
NumberBytes: Integer; FromIP: String; Port: Integer);
var
MyStream: TMemoryStream;
TmpStr: String;
begin
MyStream := TMemoryStream.Create;
try
NMUDP1.ReadStream(MyStream);
SetLength(TmpStr,NumberBytes);
MyStream.Read(TmpStr[1],NumberBytes);
Memo1.Lines.Add(FromIP+': '+TmpStr);
finally
MyStream.Free;
end;
end;
然后调用函数变为大写后用上面同样的程序传回。