c++ builder调用htmlencode
摘要:先include httpapp.hpp再调用HTMLDecode(str)即可,还包括HTMLEncode(const System::UnicodeString AStr);extern PACKAGE System::AnsiString __fastcall HTTPDecode(const System::AnsiString AStr);extern PACKAGE System::AnsiString __fastcall HTTPEncode(const System::AnsiString AStr);
阅读全文
posted @
2011-04-21 18:38
袁晓平
阅读(616)
推荐(0)
c++ builder 使用indy http调用webservice方法
摘要:TIdHTTP *http = new TIdHTTP(NULL); TStringList *formData = new TStringList(); try{ IdAntiFreeze1->OnlyWhenIdle = false; formData->Add("<?xml version=\"1.0\" encoding=\"utf-8\"?>\<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" x
阅读全文
posted @
2011-04-16 20:03
袁晓平
阅读(1116)
推荐(0)
c++ builder 读写ini文件
摘要:#include <IniFiles.hpp>TIniFile *ini; ini = new TIniFile( ChangeFileExt( Application->ExeName, ".INI" ) ); Top = ini->ReadInteger( "Form", "Top", 100 ); Left = ini->ReadInteger( "Form", "Left", 100 ); Caption = ini->ReadString( &quo
阅读全文
posted @
2011-04-14 13:50
袁晓平
阅读(617)
推荐(0)
C++ Builder编写WinForm Post数据至Web服务器并得到返回数据
摘要:需要用到Indy组件,这个安装了C++Builder就会有,有于服务端是asp.net编写的,有一个隐藏域__VIEWSTATE,所以要加上它,然后再看服务器端需要什么字段就用TStringList对象Add就可以了,具体代码如下:TIdHTTP *http = new TIdHTTP(NULL); TStringList *formData = new TStringList();try{IdAntiFreeze1->OnlyWhenIdle = false;formData->Add("act=get_print_content");formData->
阅读全文
posted @
2011-04-08 15:06
袁晓平
阅读(483)
推荐(0)
C++ Builder编写WinForm从Web服务器下载文件
摘要:UnicodeString templateSavePath = ChangeFileExt(ExtractFilePath(Application->ExeName),"tmp.doc");IdAntiFreeze1->OnlyWhenIdle = false;//设置使程序有反应.TMemoryStream *templateStream ;templateStream = new TMemoryStream() ;try {IdHTTP1->Get("http://localhost/shaj.synadmin/tmp.doc",
阅读全文
posted @
2011-04-07 17:52
袁晓平
阅读(264)
推荐(0)
c++ builder 写WinForm上传文件至Web服务器
摘要:因为项目的需要,需要做一个WinForm上传文件到Web服务端,其中WinForm用C++Builder2010编写,Web服务出来端用C#编写,弄了好久终于可以了,代码如下:WinForm:UnicodeString templateSavePath = ChangeFileExt(ExtractFilePath(Application->ExeName),"tmp_1.doc");TIdMultiPartFormDataStream *stream = new TIdMultiPartFormDataStream();TIdHTTP *http = new TId
阅读全文
posted @
2011-04-07 17:50
袁晓平
阅读(653)
推荐(0)