最新评论
re: AJAX 张建波 2008-12-30 22:10
忍不住的想问一下,yysun是大富翁的玩家还是开发人员?
Ajax的框架总结的很好
re: AJAX 专注.NET开源项目 2007-11-22 06:58
我的Blog客户端需求很简单! yuandj 2007-10-07 20:26
请教一个问题,wix的xml文档中支持不支持中文?我试了一下,好像不行。从msi反编译(用dark),产生的xml中有中文,但是用candle,light之后,再运行msi就不认中文,比如桌面中文名称。
re: AJAX xiaoxia 2007-02-02 02:54
AJAX VS bindows
mujianwei123.com 目见为 2007-01-21 06:21
谢谢快点啊
mujianwei123.com 目见为 2007-01-21 06:21
谢谢快点啊
re: 重温 Lucene[yysun] 吴建明 2006-12-08 01:16
请教一个问题:
我用ChineseAnalyzer 了后,结果发现英文不能检索了,比如
文件名wjm吴建明,现在wjm能够检索,w则不能,请问该修改哪里,可以检索到w
{ TMM7Content }
procedure TMM7Content.AppendToList(StrList: TStringList);
begin
StrList.Add('--SubPart_7452684322002_77645');
if Pos('application/smil', Self.ContentType)<=0 then
begin
StrList.Add('Content-Type:' + Self.ContentType+';name='+Self.ContentID);
end
else
begin
StrList.Add('Content-Type:' + Self.ContentType);
end;
if UseBase64 then
StrList.Add('Content-Transfer-Encoding:base64')
else
StrList.Add('Content-Transfer-Encoding: 8bit');
if Self.ContentID = '' then
begin
StrList.Add('Content-ID:<START>');
StrList.Add('Content-Location:<START>');
end
else
begin
if Pos('application/smil', Self.ContentType)<=0 then
begin
StrList.Add('Content-ID:' + '<' + Self.ContentID + '>');
StrList.Add('Content-Location:' + Self.ContentID);
StrList.Add('Content-Disposition: attachment; filename='+Self.ContentID);
end
else
begin
StrList.Add('Content-ID:' + Self.ContentID);
StrList.Add('Content-Location:' + '0000');
end;
end;
StrList.Add('');
if UseBase64 then
StrList.Add(Dimime.MimeEncodeStringNoCRLF(ContentString))
else
StrList.Add(Self.ContentString);
StrList.Add('');
end;
constructor TMM7Content.Create;
begin
inherited;
Self.UseBase64 := False;
end;
end.
procedure TMM7Soap.SetChargedParty(const Value: Integer);
begin
FChargedParty := Value;
end;
procedure TMM7Soap.SetChargedPartyID(const Value: string);
begin
FChargedPartyID := Value;
end;
procedure TMM7Soap.SetDeliveryReport(const Value: boolean);
begin
FDeliveryReport := Value;
end;
procedure TMM7Soap.SetMaxConentSize(const Value: Integer);
begin
FMaxConentSize := Value;
end;
procedure TMM7Soap.SetMM7Bcc(const Value: string);
begin
FMM7Bcc := Value;
end;
procedure TMM7Soap.SetMM7Cc(const Value: string);
begin
FMM7Cc := Value;
end;
procedure TMM7Soap.SetMM7Charset(const Value: string);
begin
FMM7Charset := Value;
end;
procedure TMM7Soap.SetMM7Pwd(const Value: string);
begin
FMM7Pwd := Value;
end;
procedure TMM7Soap.SetMM7SendTo(const Value: string);
begin
FMM7SendTo := Value;
end;
procedure TMM7Soap.SetMM7Subject(const Value: string);
begin
FMM7Subject := Value;
end;
procedure TMM7Soap.SetMM7User(const Value: string);
begin
FMM7User := Value;
end;
procedure TMM7Soap.SetOnLogXml(const Value: TLogXmlEvent);
begin
FOnLogXml := Value;
end;
procedure TMM7Soap.SetSendAddress(const Value: string);
begin
FSendAddress := Value;
end;
procedure TMM7Soap.SetServiceCode(const Value: string);
begin
FServiceCode := Value;
end;
procedure TMM7Soap.SetSslPassword(const Value: string);
begin
FSslPassword := Value;
end;
procedure TMM7Soap.SetTransactionID(const Value: Int64);
begin
FTransactionID := Value;
end;
procedure TMM7Soap.SetUseBase64Encode(const Value: boolean);
begin
FUseBase64Encode := Value;
end;
procedure TMM7Soap.SetUseMM7Auth(const Value: boolean);
begin
FUseMM7Auth := Value;
end;
procedure TMM7Soap.SetVASID(const Value: string);
begin
FVASID := Value;
end;
procedure TMM7Soap.SetVASPID(const Value: string);
begin
FVASPID := Value;
end;
procedure TMM7Soap.SSLGetPassword(var Password: string);
begin
Password := Self.SslPassword;
end;
FName := ExtractFilePath(GetModuleName(HInstance)) + 'sendmm7.ack.' + IntToStr(Self.TransactionID);
if Assigned(FOnLogXml) then
begin
if Self.FDebugMode then
begin
ResultStream.SaveToFile(FName);
FOnLogXml(Self, '接收到的xml已保存在主机' + FName + '文件中');
end
else
FOnLogXml(Self, '接收到mm7应答');
end;
if Pos('UTF-8', UpperCase(Str)) > 0 then
begin
Str := ChineseUnicode.UnicodeToChineseAnsi(Utf8Decode(Str));
StrToStream(Str, ResultStream);
end;
ResultStream.Position := 0;
xmlTree.LoadFromStream(ResultStream);
// <StatusCode>1000</StatusCode><StatusText
if xmlTree.findNamedNode('StatusCode') = nil then
raise Exception.Create('应答错误,返回详细信息:' + Copy(StreamToStr(ResultStream), 1, 4096));
Self.FStatusCode := xmlTree.findNamedNode('StatusCode').Value;
FStatusText := '';
if XmlTree.findNamedNode('StatusText') <> nil then
Self.FStatusText := XmlTree.findNamedNode('StatusText').Value;
if xmlTree.findNamedNode('MessageID') <> nil then
Self.FMessageId := xmlTree.findNamedNode('MessageID').Value;
if xmlTree.findNamedNode('Details') <> nil then
Self.FStatusText := Self.FStatusText + ',详细:' + xmlTree.findNamedNode('Details').Value;
if Self.FStatusCode <> 1000 then
begin
if Self.FStatusText <> '' then
raise Exception.Create('发送失败,错误代码:' + IntToStr(Self.FStatusCode) + ';错误信息:' + Self.FStatusText)
else
raise Exception.Create('发送失败,错误代码:' + IntToStr(Self.FStatusCode) + ';错误详细信息:' + Copy(StreamToStr(ResultStream), 1, 4096));
end
finally
ResultStream.Free;
PostStream.Free;
XmlTree.Free;
end;
end;
procedure TMM7Soap.SendMM7(url: string);
var
ResultStream: TMemoryStream;
xmlTree: TjanXmlTree;
PostStream: TMemoryStream;
CSize: Integer;
i: Integer;
Str: string;
FName: string;
begin
if Self.FContentList.Count = 0 then
raise Exception.Create('发送内容为空!');
CSize := 0;
for i := 1 to FContentList.Count do
begin
CSize := CSize + Length(TMM7Content(FContentList[i - 1]).ContentString);
end;
FSendSize := CSize;
if CSize > Self.FMaxConentSize then
raise Exception.Create('彩信内容超过最大容量:' + IntToStr(Self.FMaxConentSize) + '字节');
Self.CreateHeader;
Self.CreateSendContent;
{$IFNDEF Delphi6}
Self.HTTPOptions := [hoKeepOrigProtocol];
// Self.Request.RawHeaders.NameValueSeparator := ':';
{$ENDIF}
ResultStream := TMemoryStream.Create;
PostStream := TMemoryStream.Create;
XmlTree := TjanXmlTree.Create('', '', nil);
try
Str := '';
for i := 1 to FStrContent.Count do
begin
if Str = '' then
Str := FStrContent[i - 1]
else
Str := Str + #13#10 + FStrContent[i - 1]; //unix下默认换行符号默认为0A非0D0A
end;
StrToStream(Str, PostStream);
FName := ExtractFilePath(GetModuleName(HInstance)) + 'sendmm7.req.' + IntToStr(Self.TransactionID);
if Assigned(FOnLogXml) then
begin
if Self.FDebugMode then
begin
FStrContent.SaveToFile(FName);
FOnLogXml(Self, '发送的xml已保存在主机' + FName + '文件中');
end
else
FOnLogXml(Self, '开始发送mm7请求,url=' + url);
end;
PostStream.Position := 0;
Self.Post(Url, PostStream, ResultStream);
Str := StreamToStr(ResultStream);
if AnsiSameText(UpperCase(LProto), 'HTTPS') then //create https object
begin
{$IFDEF DELPHI6}
if Ssl = nil then
begin
Self.SSL := TIdConnectionInterceptOpenSSL.Create(nil);
end;
SSl.SSLOptions.Method := sslvSSLv23;
Self.Intercept := SSl;
Ssl.OnGetPassword := Self.SSLGetPassword;
Self.SocksInfo.Host := ''; //不支持同时使用socks和https
Self.SocksInfo.Port := 0;
Self.SocksInfo.Version := svNoSocks;
{$ELSE}
if Ssl = nil then
begin
Self.SSL := TIdSSLIoHandlerSocket.Create(nil);
Ssl.SocksInfo := nil;
end;
SSl.SSLOptions.Method := sslvSSLv23;
if (Self.IOHandler is TIdIOHandlerSocket) and
((Self.IOHandler as TIdIOHandlerSocket).SocksInfo <> nil) then
begin
// Ssl.SocksInfo := (Self.IOHandler as TIdIOHandlerSocket).SocksInfo;
// don't support
end;
OldHandler := Self.IOHandler;
Self.IOHandler := SSl;
Ssl.OnGetPassword := Self.SSLGetPassword;
{$ENDIF}
end
else
{$IFDEF DELPHI6}
Self.Intercept := nil;
{$ELSE}
Self.IOHandler := nil;
{$ENDIF}
try
inherited;
finally
{$IFNDEF DELPHI6}
if OldHandler <> nil then
Self.IOHandler := OldHandler;
{$ENDIF}
end;
end;
function TMM7Soap.GetLoopTransId: Int64;
begin
Result := Self.FTransactionID;
Inc(Self.FTransactionID);
if FTransactionId > 1000000 * 100 then
FTransactionId := 1000000;
end;
for i := 1 to Self.FContentList.Count do
begin
TMM7Content(FcontentList[i - 1]).AppendToList(FStrContent);
end;
Add('--SubPart_7452684322002_77645--');
Add('----NextPart_0_2817_24856--');
// Add('');
end;
finally
tmpStrList.Free;
end;
end;
destructor TMM7Soap.Destroy;
begin
ClearContentList;
FContentList.Free;
FStrContent.Free;
if Self.SSL <> nil then
FreeAndNil(SSL);
inherited;
end;
{$IFDEF DELPHI6}
procedure TMM7Soap.DoRequest(const AMethod: TIdHTTPMethod; AURL: string;
const ASource: TObject; const AResponseContent: TStream);
var
LDoc,
LHost,
LPath,
LProto,
LPort,
LBookmark: string;
// OldHander:
{$ELSE}
procedure TMM7Soap.DoRequest(const AMethod: TIdHTTPMethod; AURL: string;
const ASource, AResponseContent: TStream);
var
LProto: string;
OldHandler: TIdIOHandler;
{$ENDIF}
begin
{$IFDEF DELPHI6}
ProtocolVersion := Pv1_1;
ParseURI(AURL, LProto, LHost, LPath, LDoc, LPort, LBookmark);
{$ELSE}
Url.Uri := AURL;
LProto := Url.Protocol;
OldHandler := nil;
{$ENDIF}
Str := Str + '</Recipients><ServiceCode>' + Self.FServiceCode + '</ServiceCode>'; //业务代码ServiceCode不许为空
if Self.FDeliveryReport then
Str := Str + '<DeliveryReport>true</DeliveryReport>'
else
Str := Str + '<DeliveryReport>false</DeliveryReport>';
if LowerCase(Self.MM7Charset) = 'utf-8' then
Str := Str + '<Subject>' + Utf8Encode(ChineseUnicode.ChineseAnsiToUnicode(Self.MM7Subject)) + '</Subject>'
else
Str := Str + '<Subject>' + Self.MM7Subject + '</Subject>';
Str := Str+ '<Content href="cid:mms_cid" />';
case Self.FChargedParty of
0: Str := Str + '<ChargedParty>Sender</ChargedParty>';
1: Str := Str + '<ChargedParty>Recipient</ChargedParty>';
2: Str := Str + '<ChargedParty>Both</ChargedParty>';
3: Str := Str + '<ChargedParty>Neither</ChargedParty>';
4: Str := Str + '<ChargedParty>ThirdParty</ChargedParty>';
end;
Str := Str + '<ChargedPartyID>' + Self.FChargedPartyID + '</ChargedPartyID>';
Str := Str + '</SubmitReq></env:Body></env:Envelope>';
Add(Str);
//添加信息内容
Add('----NextPart_0_2817_24856');
//<START>
Add('Content-Type:multipart/related;start="' + TMM7Content(FContentList[0]).ContentID + '";type="application/smil";boundary="SubPart_7452684322002_77645"');
Add('Content-ID:<mms_cid>');
Add('Content-Transfer-Encoding:8bit');
Add('');
tmpStrList.Text := StringReplace(Self.FMM7Cc, ',', #13#10, [rfReplaceAll]);
if tmpStrList.Count > 0 then
begin
Str := Str + '<Cc>';
for i := 1 to tmpStrList.Count do
begin
if Trim(tmpStrList[i - 1]) <> '' then
begin
if Pos('@', tmpStrList[i - 1]) > 0 then
Str := Str + '<RFC2822Address>' + Trim(tmpStrList[i - 1]) + '</RFC2822Address>'
else
Str := Str + '<Number>' + Trim(tmpStrList[i - 1]) + '</Number>';
end;
end;
Str := Str + '</Cc>';
end;
tmpStrList.Text := StringReplace(Self.FMM7BCc, ',', #13#10, [rfReplaceAll]);
if tmpStrList.Count > 0 then
begin
Str := Str + '<Bcc>';
for i := 1 to tmpStrList.Count do
begin
if Trim(tmpStrList[i - 1]) <> '' then
begin
if Pos('@', tmpStrList[i - 1]) > 0 then
Str := Str + '<RFC2822Address>' + Trim(tmpStrList[i - 1]) + '</RFC2822Address>'
else
Str := Str + '<Number>' + Trim(tmpStrList[i - 1]) + '</Number>';
end;
end;
Str := Str + '</Bcc>';
end;
procedure TMM7Soap.CreateSendContent;
var
Str: string;
i: Integer;
tmpStrList: TStringList;
begin
Self.FStrContent.Clear;
tmpStrList := TStringList.Create;
try
FStrContent.Add('this is a multi-part message in MIME format');
FStrContent.Add('');
FStrContent.Add('');
FStrContent.Add('----NextPart_0_2817_24856');
// Self.GetLoopTransId;
with FStrContent do
begin
Add('Content-Type:text/xml;charset="' + Self.FMM7Charset + '"');
Add('Content-Transfer-Encoding:8bit');
Add('Content-ID:<mm7-vasp>');
Add('');
Str := '<?xml version="1.0" encoding="' + FMM7CharSet + '"?><env:Envelope xmlns:env="
http://schemas.xmlsoap.org/soap/envelope/"><env:Header><mm7:TransactionID xmlns:mm7="
http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-0" env:mustUnderstand="1">'
+ IntToStr(Self.FTransactionID)
+ '</mm7:TransactionID></env:Header><env:Body>'
+ '<SubmitReq xmlns="
http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-0">'
+ '<MM7Version>6.3.0</MM7Version>';
if (Self.VASID <> '') or (Self.VASPID <> '') or (Self.SendAddress <> '') then
begin
if (Self.VASID = '') or (Self.VASPID = '') then
raise Exception.Create('SP代码VASPID和服务代码VASID均不允许为空!');
Str := Str + '<SenderIdentification><VASPID>' + VasPid + '</VASPID><VASID>' + VasId + '</VASID><SenderAddress>' + SendAddress + '</SenderAddress></SenderIdentification>';
end;
tmpStrList.Text := StringReplace(Self.FMM7SendTo, ',', #13#10, [rfReplaceAll]);
if tmpStrList.Count = 0 then
raise Exception.Create('收信人地址为空!');
Str := Str + '<Recipients><To>';
for i := 1 to tmpStrList.Count do
begin
if Trim(tmpStrList[i - 1]) <> '' then
begin
if Pos('@', tmpStrList[i - 1]) > 0 then
Str := Str + '<RFC2822Address>' + Trim(tmpStrList[i - 1]) + '</RFC2822Address>'
else
Str := Str + '<Number>' + Trim(tmpStrList[i - 1]) + '</Number>';
end;
end;
Str := Str + '</To>';
procedure TMM7Soap.CreateHeader;
begin
{$IFDEF Delphi6}
Self.Request.ExtraHeaders.Clear;
with Self.Request.ExtraHeaders do
{$ELSE}
Self.Request.CustomHeaders.Clear;
with Self.Request.CustomHeaders do
{$ENDIF}
begin
Add('Content-Transfer-Encoding:8bit');
if Self.UseMM7Auth and (FMM7User <> '') then
Add('Authorization:Basic ' + DIMime.MimeEncodeStringNoCRLF(Self.FMM7User + ':' + Self.FMM7Pwd));
Add('SOAPAction:""');
Add('MM7APIVersion:V1.5.3_20040621');
Add('Connection: Keep-Alive');
//Keep-Alive'); //短连接方式,长连接可采用keep-alive
Add('Mime-Version:1.0');
end;
Self.Request.ContentType := 'multipart/related; boundary="--NextPart_0_2817_24856";type="text/xml";start="<mm7-vasp>"';
Self.Request.Accept := '';
Self.Request.UserAgent := '';
end;
{ TMM7Soap }
procedure TMM7Soap.AddContent(ContentString, ContentId: string;
ContentType: TMM7ContentType);
var
Cont: TMM7Content;
begin
Cont := TMM7Content.Create;
try
Cont.ContentString := ContentString;
Cont.ContentID := ContentId;
Cont.ContentType := MM7ContentType[Ord(ContentType)];
if (ContentType = _Text) or (ContentType = _Xml) or (ContentType = _html) then
begin
Cont.ContentType := Cont.ContentType + ';charset="' + Self.FMM7Charset + '"';
if LowerCase(Self.MM7Charset) = 'utf-8' then
begin
Cont.ContentString := Utf8Encode(ChineseUnicode.ChineseAnsiToUnicode(Cont.ContentString));
Cont.ContentID := Utf8Encode(ChineseUnicode.ChineseAnsiToUnicode(Cont.ContentID));
//13851852109
end;
end
else
begin
if ContentType <> _smil then
begin
if Self.UseBase64Encode then
begin
Cont.UseBase64 := True;
end;
end;
end;
except
on E: Exception do
begin
Cont.Free;
raise Exception.Create('添加彩信内容出现错误,content_id=' + Contentid + ';' + E.Message);
end;
end;
if ContentType = _Smil then
begin
Cont.ContentID := '<0000>';
// Self.FContentList.Add(Cont);
Self.FContentList.Insert(0, Cont); //add to head
end
else
Self.FContentList.Add(Cont);
end;
procedure TMM7Soap.ClearContentList;
var
i: Integer;
begin
for i := 1 to FContentList.Count do
begin
TMM7Content(FContentList[i - 1]).Free;
end;
FContentList.Clear;
Self.FMM7SendTo := '';
Self.FMM7Cc := '';
Self.FMM7Bcc := '';
end;
constructor TMM7Soap.Create(aOwner: TComponent);
begin
inherited;
Self.UseMM7Auth := True;
FContentList := TList.Create;
FStrContent := TStringList.Create;
FMM7Charset := 'GB2312';
FTransactionID := 1000000;
Self.FDeliveryReport := True;
Self.FChargedParty := 4;
Self.FServiceCode := '000000';
Self.FMM7User := 'zxme';
Self.FMM7Pwd := 'zxme';
Self.FChargedPartyID := '13980000035';
Self.FSendAddress := '5555';
Self.FVASID := '5555';
Self.FVASPID := '805555';
Self.FMaxConentSize := 90 * 1024; //100k
Self.FUseBase64Encode := True;
Self.SSL := nil;
end;
FStatusText: string;
FMaxConentSize: Integer;
FOnLogXml: TLogXmlEvent;
FMessageId: string;
FUseBase64Encode: boolean;
procedure CreateHeader;
procedure CreateSendContent;
procedure SetMM7Pwd(const Value: string);
procedure SetMM7User(const Value: string);
procedure SetUseMM7Auth(const Value: boolean);
procedure SetMM7Charset(const Value: string);
procedure SetTransactionID(const Value: Int64);
procedure SetChargedParty(const Value: Integer);
procedure SetChargedPartyID(const Value: string);
procedure SetDeliveryReport(const Value: boolean);
procedure SetMM7Subject(const Value: string);
procedure SetSendAddress(const Value: string);
procedure SetServiceCode(const Value: string);
procedure SetVASID(const Value: string);
procedure SetVASPID(const Value: string);
procedure SetMM7Bcc(const Value: string);
procedure SetMM7Cc(const Value: string);
procedure SetMM7SendTo(const Value: string);
procedure SetMaxConentSize(const Value: Integer);
procedure SetOnLogXml(const Value: TLogXmlEvent);
procedure SetUseBase64Encode(const Value: boolean);
procedure SSLGetPassword(var Password: string);
private
FDebugMode: boolean;
FSslPassword: string;
procedure SetSslPassword(const Value: string);
public
constructor Create(aOwner: TComponent); override;
destructor Destroy; override;
procedure SendMM7(url: string);
procedure ClearContentList;
{$IFDEF DELPHI6}
procedure DoRequest(const AMethod: TIdHTTPMethod; AURL: string;
const ASource: TObject; const AResponseContent: TStream); override;
{$ELSE}
procedure DoRequest(const AMethod: TIdHTTPMethod; AURL: string;
const ASource, AResponseContent: TStream); override;
{$ENDIF}
function GetLoopTransId: Int64;
property MM7User: string read FMM7User write SetMM7User;
property MM7Pwd: string read FMM7Pwd write SetMM7Pwd;
property UseMM7Auth: boolean read FUseMM7Auth write SetUseMM7Auth;
property MM7Charset: string read FMM7Charset write SetMM7Charset;
procedure AddContent(ContentString: string; ContentId: string; ContentType: TMM7ContentType);
property TransactionID: Int64 read FTransactionID write SetTransactionID;
property MM7Subject: string read FMM7Subject write SetMM7Subject;
property VASID: string read FVASID write SetVASID;
property VASPID: string read FVASPID write SetVASPID;
property ServiceCode: string read FServiceCode write SetServiceCode;
property SendAddress: string read FSendAddress write SetSendAddress;
property ChargedPartyID: string read FChargedPartyID write SetChargedPartyID;
property ChargedParty: Integer read FChargedParty write SetChargedParty;
property DeliveryReport: boolean read FDeliveryReport write SetDeliveryReport;
property MM7SendTo: string read FMM7SendTo write SetMM7SendTo;
property MM7Cc: string read FMM7Cc write SetMM7Cc;
property MM7Bcc: string read FMM7Bcc write SetMM7Bcc;
property StatusCode: Integer read FStatusCode;
property StatusText: string read FStatusText;
property MaxConentSize: Integer read FMaxConentSize write SetMaxConentSize;
property OnLogXml: TLogXmlEvent read FOnLogXml write SetOnLogXml;
property SendSize: Integer read FSendSize;
property MessageId: string read FMessageId;
property UseBase64Encode: boolean read FUseBase64Encode write SetUseBase64Encode;
property SslPassword: string read FSslPassword write SetSslPassword;
property DebugMode: boolean read FDebugMode write FDebugMode;
end;
implementation
98年到delphibbs,受益良多,有感用delphi越来越少,故发送一个原创的delphi发送mm7的控件源码以资鼓励,希望delphi继续长青不老
unit MM7SoapUnit;
// mm7 soap协议简单实现,初始化版本 2006/07/11 ver 1.0
// 参考自中国移动mm7统一api java源代码 ,只实现发送彩信部分
//支持kylix3/delphi6-7 支持https功能(标准的中兴api不支持)
{$IFDEF MSWINDOWS}
{$IFDEF VER140}
{$IFNDEF USEDELPHI7INDY}
{$DEFINE Delphi6}
{$ENDIF}
{$ENDIF}
{$ENDIF}
interface
uses
SysUtils, Classes, GlobalDefine, IdGlobal,
IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
{$IFDEF delphi6}
IdHTTPD6Patch, IdSSLOpenSSL, IdSocks,
{$ELSE}
IdHTTP, IdSSLOpenSSL, IdIOHandler, IdIOHandlerSocket,
{$ENDIF}
DIMime, janXMLTree, ChineseUnicode;
const MM7ContentType: array[0..28] of string = (
'text/plain', 'text/xml', 'application/smil', 'audio/amr', 'audio/midi',
'text/i-melod', 'text/e-melody', 'image/gif', 'image/jpeg', 'image/vnd.wap.wbmp',
'image/png', 'audio/wav', 'audio/mpeg',
'audio/mmf', 'audio/m3u',
'video/mpeg', 'video/avi', 'application/vnd.rn-realmedia', 'video/x-ms-asf', 'image/bmp',
'application/vnd.ms-word', 'application/vnd.ms-project', 'application/vnd.ms-powerpoint', 'application/vnd.ms-excel', 'video/quicktime',
'application/zip', 'application/rar', 'text/html', 'application/octet-stream');
type
TMM7ContentType = (_TEXT, _XML, _SMIL, _AMR, _MIDI,
_I_MELODY, _E_MELODY, _GIF, _JPEG, _WBMP,
_PNG, _wav, _mp3,
_mmf, _m3u,
_mpeg, _avi, _real, _asf, _bmp,
_word, _project, _ppt, _excel, _quicktime,
_zip, _rar, _html, _UnKown);
TLogXmlEvent = procedure(Sender: TObject; xmlStr: string) of object;
TMM7Content = class
public
UseBase64: boolean;
ContentString: string; //发送内容
ContentID: string; //content id
ContentType: string; //content type
constructor Create;
procedure AppendToList(StrList: TStringList);
end;
{$IFDEF DELPHI6}
TMM7Soap = class(TPatchIdHTTP)
private
SSL: TIdConnectionInterceptOpenSSL;
{$ELSE}
TMM7Soap = class(TIdHttp)
private
SSL: TIdSSLIoHandlerSocket;
{$ENDIF}
FUseMM7Auth: boolean;
FSendSize: Integer;
FContentList: TList;
FStrContent: TStringList;
FMM7Pwd: string;
FMM7User: string;
FMM7Charset: string;
FTransactionID: Int64;
FDeliveryReport: boolean;
FChargedParty: Integer;
FChargedPartyID: string;
FSendAddress: string;
FVASID: string;
FServiceCode: string;
FMM7Subject: string;
FVASPID: string;
FMM7Bcc: string;
FMM7SendTo: string;
FMM7Cc: string;
FStatusCode: Integer;
Word写blog不好,word写出来的东西冗余代码居多,你从word里面转贴东西察看源代码就知道了。
MS最近出来一个Windows Live Writer似乎还不错。
re: 重温 Lucene[yysun] 混世魔王 2006-06-30 17:16
体工队任何感 大笔底变化程度不不地方病的保持蔫不溜扩大法兄弟党出发点 西南非干部离豆腐花工会大会离开哈巴狗联合国离开反对内,可内部的,部分内离开才能巴里坤巴里坤不离开法国蔫不溜棵内罗毕农村枫岭关开办离开了了南北朝礼服呢巴里坤内了了礼服呢吧离开法干部龙女出来克格勃内法国一离开发病率考察发离开鬼画符才能红铃虫能够离开国内厂离开感分厘卡感分不开辽宁屡次了辽宁离开尼勒克齿鸟类;规偶发就;地热田江汉平原台赕佛就 工会;地方军核电厂肺结核感;吹风机火车;法国成功蝴蝶花低哦苹果热带广泛滴滴答答离开了 了豆腐花了了充分口号广泛尼罗河离开法进化论反对了流窜犯高利贷解放离开弧光灯分厘卡化工凉粉草客观后就百衲本 ?
re: AJAX 混世魔王 2006-06-30 17:15
水电部感充分,机关报科技辅导班的一红点颏机好和就艰苦共和党法艰苦规划局共和国孔家店国内年改革地方官德国连裆裤法兰克福管理棵 两分法多瑙河规定南方该哦的高利贷星霍公路当年合格率厂妇女离开固定汇率妇代会管理棵孤苦伶仃法了克当量可副林带核废料妇代会机年 飞机广泛大家 耕地后连锅端分厘卡化工领导和地方官离开发祥地领导的法律恢复开绿灯辉钴矿棵可离开防护林扩大解放后离开地方 读后感离开冲锋号离开捕获量棵出来哈里发考察河北了巴里坤 ?
re: AJAX 混世魔王 2006-06-30 14:13
你们都说的是什么啊/我怎么看不懂啊?晕晕
Dr. sun,引用的MS的文章很好,如果有谁能够提供中文则更好。在实践中一开始我也是考虑短的Entity Life Cycle,不过后来发现,适度的Entity Life Cycle管理实现领域意义上的cache对于改进性能还是有些意义的。
re: AJAX gzrcrxAdmin 2006-06-19 08:19
呵呵~还蛮多大富翁上的人喔,学习中~~~~
不错啊,很好.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
...
把眼界放到.net的开源上吧,看看castle,这些东东会给你带来不同的感觉的
---
现在的 EJB 3.0 借助 Annotation 实现了瘦身,完全回到了 POJOs 的路线上来。
---
POJO只是在某种情况下的解决方案,当你使用分布式对象的时候怎么也不可能用POJO,而EJB一个重要的功能就是提供了良好的分布式框架,MTS也是一个目的。只不过以前使用EJB的解决方案往往分布过头了,所以才冒出个简单有效的POJO,但这不是全部。
dr. sun:
没有Container情况下,ORM的意义还是有的,相反AOP没有多少意义。
对于annotation,正所谓“成也萧何,败也萧何”,总有一天同样会成为一种负担。
晕,你这个家伙一定是在外企工作的,当然这也没有办法,总不能将这些术语用中文表示。
看的出来你的功底不浅哦
就我目前的感觉,EJB3.0中的对象持久化方案和Hibernate区别不大,这也间接说明Hibernate实在是太成功了。
re: 重温 Lucene[yysun] dongde 2006-06-13 20:23
我用的是 ChineseAnalyzer 的版本是 1.3.2.2 ,lucene.net
的版本是 1.3.3.1,这样是可以的,可是当我改成 1.4版本的
lucene.net的时候却会报错,请高手指点
re: 重温 Lucene[yysun] litao_2006 2006-06-13 04:40
我做.net下的lucene,用的是您的ChineseAnalyser,一开始是死循环,忙了好一阵发现了-1和0 的差别,但还是不能正常工作,我看您的留言
"string.CompareOrdinal(...) // C# ",这句是在哪呢?我在那三个文件里没找到...
re: SQL/e Marcantonio 2006-05-24 19:19
vb.net sources to convert sql2sdf and sql2mysql:
http://www.magnarapa.com/d/
re: AJAX ajax 2006-05-11 23:51
Joyistar Releases a Visual AJAX tool and library for AJAX Developers
It's the best powerful visual AJAX IDE I've seen before. You can develope your web application in it just like what you do in VB or Delphi based on its powerful AJAX components libs. And it also support sourceinsight and it's compatible with IE, Firefox.... Above of all, it's unrelevant with server side.
Here is free trial.
http://www.joyistar.com
re: 申请 WB Editor 2 注册码 从不说话 2006-05-11 02:28
恩
re: 申请 WB Editor 2 注册码 junying 2006-05-10 08:46
nihao
re: 申请 WB Editor 2 注册码 mr.jhonson 2006-05-10 01:19
i don't agree with you about your opinoin
re: SQL/e 夏林 2006-05-08 21:08
不知道跟SQL Lite比性能如何
re: SQL/e LirenZhao 2006-05-08 19:16
"Visual Studio 2005 带的 SQL Server Mobile 被限制只能运行在 Tablet PC 上" 这句话有待商榷吧?