TA的每日心情 | 郁闷 2017-9-28 15:34 |
---|
签到天数: 3 天 连续签到: 1 天 [LV.2]测试排长
|
3#
楼主 |
发表于 2011-6-17 16:16:57
|
只看该作者
贴点脚本代码出来:
Action()
{...
lr_start_transaction("打开文档");
web_custom_request("word2009-118110kV.doc",
"URL=http://10.138.215.239:7001/webdav/files/word2009-118110kV.doc",
"Method=LOCK",
"TargetFrame=",
"Resource=0",
"RecContentType=text/xml",
"Referer=",
"Snapshot=t9.inf",
"Mode=HTML",
"Body=<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n"
"<lockinfo xmlns=\"DAV:\">\r\n"
"<locktype>\r\n"
"<write/>\r\n"
"</locktype>\r\n"
"<lockscope>\r\n"
"<exclusive/>\r\n"
"</lockscope>\r\n"
"<owner>Administrator</owner>\r\n"
"</lockinfo>\r\n",
EXTRARES,
"URL=word2009-118110kV.doc", ENDITEM,
LAST);
//在线打开一个文档时,会产生一个动态字符串token,在下面保存文档时用来唯一标识文档
...
lr_end_transaction("打开文档", LR_AUTO);
lr_start_transaction("保存");
web_custom_request("files",
"URL=http://10.138.215.239:7001/webdav/files",
"Method=OPTIONS",
"TargetFrame=",
"Resource=0",
"Referer=",
"Mode=HTML",
LAST);
web_custom_request("word2009-118110kV.doc_3",
"URL=http://10.138.215.239:7001/webdav/files/word2009-118110kV.doc",
"Method=PROPFIND",
"TargetFrame=",
"Resource=0",
"RecContentType=text/xml",
"Referer=",
"Snapshot=t10.inf",
"Mode=HTML",
"Body=<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n"
"<a:propfind xmlns:a=\"DAV:\" xmlns:b=\"urn:schemas-microsoft-com:datatypes\">\r\n"
"<a:prop xmlns:c=\"urn:schemas-microsoft-comfficeffice\">\r\n"
"<c:save-profile-form-location/>\r\n"
"</a:prop>\r\n"
"</a:propfind>\r\n",
LAST);
//在上面这段代码中,保存编辑后的文档时,会用到前面产生的动态字符串token
...
lr_end_transaction("保存", LR_AUTO);
lr_start_transaction("关闭文档");
web_custom_request("word2009-118110kV.doc_6",
"URL=http://10.138.215.239:7001/webdav/files/word2009-118110kV.doc",
"Method=UNLOCK",
"TargetFrame=",
"Resource=1",
"Referer=",
LAST);
lr_end_transaction("关闭文档", LR_AUTO);
return 0;
} |
|