当前位置:主页>仓库管理软件> 列表

在线急等:怎样把http请求报文转换成html报文 找工业企业财务软件

库存管理软件版1楼: 怎样把http请求报文转换成html报文,已经接收到了报文,但我需要的是html报文,这中间怎么处理才能把http报文转换成html报文?????求代码,可以举个例子

具体问题是这样的:客户端向服务器发送一个请求报文,但是在发送过程中要经过一个''中转站'',在这个''中转站''中要把客户端发过来的报文进行处理,就是把请求报文转换为html报文

2楼: 用SQL语句:
create database 如erp管理软件

3楼: 各位高手帮下小弟吧

4楼: 请写详细点啊,把参数带上啊.

5楼: Create 数据库简单
转换不会

6楼: 1.創建什么樣的數據庫?SQL Server?Access?還是其他
2.你說的是要HTTP的連接﹑請求﹑響應﹑斷開的信息,還是響應之后的html頁面源文件??

库存管理软件版7楼: to:BrainYang
1 创建SQL Server数据库
2 是请求报文,具体问题是这样的:客户端向服务器发送一个请求报文,但是在发送过程中要经过一个''中转站'',在这个''中转站''中要把客户端发过来的报文进行处理,就是把请求报文转换为html报文

8楼: 幫你提前
我也想知道 ̄ ̄ ̄

9楼: 1.用dao或sql语句都可。


2不清楚。

10楼: 创建数据库SQL语言就可以,create database
但是报文不太明白!
直接保存成文本格式不行吗?IE也是可以打开文本格式的呀!
还有就是,如果数据保存到数据库中了,要是想通过IE查看可以用ASP呀,很简单的几段代码就可以呀!

11楼: 1.以下創建數據庫的例子已測試通過
----------DataModule部分-----------------
unit U_DM;
interface
uses
SysUtils, Classes, DB, ADODB;
type
Tdm = class(TDataModule)
ADOConn: TADOConnection;
ADOQry: TADOQuery;
ADOQryTmp: TADOQuery;
private
{ Private declarations }
public
{ Public declarations }
end;
var
dm: Tdm;
implementation
{$R *.dfm}
end.
------------主窗體部分------------------
unit u_CreateSQLServerDB;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, DB, ADODB;

type
Tf_CreateSQLServerDB = class(TForm)
edtServer: TEdit;
edtDB: TEdit;
rgConnectMethod: TRadioGroup;
lblServer: TLabel;
lbldB: TLabel;
btnCreate: TButton;
edtUserName: TEdit;
edtPassword: TEdit;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
procedure btnCreateClick(Sender: TObject);
private
{ Private declarations }
bConnected: Boolean;
function GetLocalUserName: string;
//不同的連接方式得到不同的連接字符串
function GetConnDBStr(bTestDB: Boolean): string;
function TestConnection(ConnStr, UserID, UserPswd: string; var
errMsg: string): Boolean; //測試連接是否成功
function DBTableExists(conn: TADOConnection; DBTableName: string; bDataBase:
Boolean): Boolean; //表或數據是否已經存在
public
{ Public declarations }
end;

const
{
Initial Catalog ==> DataBase (eg. eLibrary)
Data Source ==> Server Name (eg. (Local))
}
//Test Connect. Without DataBase Name
SQLCONWINSTR = ''Provider=SQLOLEDB.1;Integrated Security=SSPI;''
+ ''Persist Security Info=False;User ID=%s;Data Source=%s'';


SQLCONDBSTR = ''Provider=SQLOLEDB.1;Password=%s;Persist Security Info=True;''
+ ''User ID=%s;Data Source=%s'';

//Connect to Server with DatabaseName
SQLCONWINSTREX = ''Provider=SQLOLEDB.1;Integrated Security=SSPI;''
+ ''Persist Security Info=False;User ID=%s;Initial Catalog=%s;Data Source=%s'';
SQLCONDBSTREX = ''Provider=SQLOLEDB.1;Password=%s;Persist Security Info=True;''
+ ''User ID=%s;Initial Catalog=%s;Data Source=%s'';

SQLCREATESQLDB = ''Create Database %s'';
SQLCREATESQLDBOK = ''Create Database %s successful!'';
SQLCREATESQLDBERR = ''Create Database %s error!'';

SQLDBEXISTS =
''select * from master.dbo.sysdatabases where name=''''%s''''''; //數據庫是否已存在
SQLTABLEEXISTS = ''select * from master.dbo.sysobjects where name=''''%s''''''
+ '' and XType=''''U''''''; //Table是否已存在
var
f_CreateSQLServerDB: Tf_CreateSQLServerDB;
implementation
uses U_DM;
{$R *.dfm}
procedure StrResetLength(var S: AnsiString);
begin
SetLength(S, StrLen(PChar(S)));
end;

function ExecSQLEx(ADOQry: TADOQuery; SQLStr: string;
var ErrMsg: string): Boolean;
begin
Result := False;
with ADOQry do
begin
SQL.Clear;
SQL.Add(SQlStr);
try
ExecSQL;
Result := True;
except
on e: Exception do
ErrMsg := e.Message;
end;
end;
end;

function Tf_CreateSQLServerDB.TestConnection(ConnStr, UserID, UserPswd: string; var
errMsg: string): Boolean;
var
aq: TADOConnection;
begin
Result := False;
aq := TADOConnection.Create(nil);
with aq do
try
ConnectionString := ConnStr;
LoginPrompt := False;
aq.Open;
Result := Connected;
if Connected = true then
begin
Close;
errMsg := ''Connect successful!'';
end
else
errMsg := ''Connect failed!'';
finally


freeandnil(aq);
end;
end;

function Tf_CreateSQLServerDB.GetLocalUserName: string;
var
Count: DWORD;
begin
Count := 256 + 1; // UNLEN + 1
// set buffer size to 256 + 2 characters
SetLength(Result, Count);
if GetUserName(PChar(Result), Count) then
StrResetLength(Result)
else
Result := '''';
end;

function Tf_CreateSQLServerDB.GetConnDBStr(bTestDB: Boolean): string;
var
strUser: string;
begin
strUser := GetLocalUserName;
Result := '''';
if bTestDB = false then
begin
case rgConnectMethod.itemindex of
0: Result := Format(SQLCONWINSTR, [strUser, edtServer.Text]);
1: Result := Format(SQLCONDBSTR, [edtPassword.Text, edtUserName.Text, edtServer.Text]);
end;
end
else
begin
case rgConnectMethod.ItemIndex of
0: Result := Format(SQLCONWINSTREX, [strUser, edtdb.Text, edtServer.Text]);
1: result := Format(SQLCONDBSTREX, [edtPassword.Text, edtUserName.Text,

edtDB.Text, edtServer.Text]);
end;
end;
end;

procedure Tf_CreateSQLServerDB.btnCreateClick(Sender: TObject);
var
errMsg, strConn: string;
bTestConnected: Boolean;
begin
dm.ADOConn.Connected := False;
bConnected := False;
strConn := GetConnDBStr(false);
bTestConnected := TestConnection(strConn, edtUserName.text,
edtPassword.text, errMsg);
if bTestConnected then
begin
dm.ADOConn.Close;
dm.ADOConn.ConnectionString := strConn;
//DataBase Exists
if DBTableExists(dm.ADOConn, edtDB.Text, True) then
begin
//.......
ShowMessage(''DataBase [''+edtDB.TExt+''] already exists!'');
bConnected := True;
end
else
begin //DataBase not exists
// dm.ADOQry.ConnectionString := GetConnDBStr(false);
bTestConnected := ExecSQLEX(dm.ADOQry, Format(SQLCREATESQLDB,
[edtDB.Text]), errMsg);
if not bTestConnected then
ShowMessage(errMsg)
else
begin
ShowMessage(Format(SQLCREATESQLDBOK, [edtDB.text]));
strConn := GetConnDBStr(true);
with dm.ADOConn do
begin
Close;
ConnectionString := strConn; //連接到服務器指定數據庫
Connected := true;
end;
bConnected := True;
end;
end;
end
else //Database not exist,don''t create it
begin
dm.ADOConn.Close;
end;

end;

function Tf_CreateSQLServerDB.DBTableExists(conn: TADOConnection;
DBTableName: string; bDataBase: Boolean): Boolean;
var
aq: TADOQuery;
strSQL: string;
begin
Result := False;
aq := TADOQuery.Create(nil);
try
Conn.Close;
aq.Connection := conn;
if not conn.Connected then
conn.Connected := True;
if bDataBase then
strSQL := Format(SQLDBEXISTS, [DBTableName])
else
strSQL := Format(SQLTABLEEXISTS, [DBTableName]);
with aq do
begin
sql.clear;
SQL.Add(strSQL);
open;
Result := RecordCount > 0;
Close;
end;
finally
aq.Free;
end;
end;

end.

12楼: to:BrainYang
第二个问题 http报文转换为html报文呢? 如工业企业财务软件

13楼: 嘿嘿,不懂。

库存管理软件版14楼: 郁闷了,高手们帮忙