zoukankan
html css js c++ java
xmlrpc(2)first demo_v2
[XmlRpcMethod(
"
blogger.getUsersBlogs
"
, Description
=
"
获取博客信息
"
)]
public
BlogInfo[] getUsersBlogs(
string
appKey,
string
username,
string
password)
{
BlogInfo[] infoarr
=
new
BlogInfo[
1
];
for
(
int
i
=
0
; i
<
1
; i
++
)
{
Member member
=
GetUser(username, password);
if
(member
!=
null
)
{
infoarr[i].url
=
GetAppPath()
+
"
Blog/User/Default.aspx?UserName=
"
+
HttpContext.Current.Server.UrlEncode(member.UserName);
infoarr[i].blogName
=
GetBlogSetting(Convert.ToInt32(member.MemberID)).BlogName;
infoarr[i].blogid
=
member.MemberID.ToString();
}
}
return
infoarr;
}
[XmlRpcMethod(
"
metaWeblog.getCategories
"
, Description
=
"
获取分类列表
"
)]
public
CategoryInfo[] getCategories(
string
blogid,
string
username,
string
password)
{
TList
<
BlogKind
>
list
=
GetBlogKind(
int
.Parse(blogid));
CategoryInfo[] infoarr
=
new
CategoryInfo[list.Count];
for
(
int
i
=
0
; i
<
infoarr.Length; i
++
)
{
infoarr[i].categoryid
=
list[i].BlogKindID.ToString();
infoarr[i].description
=
list[i].KindName;
infoarr[i].htmlUrl
=
""
;
infoarr[i].rssUrl
=
""
;
infoarr[i].title
=
list[i].KindName;
}
return
infoarr;
}
[XmlRpcMethod(
"
metaWeblog.newPost
"
, Description
=
"
发表日志
"
)]
public
string
newPost(
string
blogid,
string
username,
string
password, CookComputing.MetaWeblog.Post post,
bool
publish)
{
Member member
=
GetUser(username, password);
if
(member
!=
null
)
{
BlogTopic xBlogTopic
=
new
BlogTopic();
xBlogTopic.Title
=
post.title;
xBlogTopic.Content
=
post.description;
xBlogTopic.Weather
=
0
;
xBlogTopic.Face
=
1
;
xBlogTopic.CommentNum
=
0
;
xBlogTopic.IsBast
=
0
;
xBlogTopic.IsShow
=
1
;
xBlogTopic.ComeFrom
=
username;
xBlogTopic.Summary
=
""
;
xBlogTopic.IsTop
=
0
;
xBlogTopic.LastIp
=
HttpContext.Current.Request.Url.Host;
xBlogTopic.Hits
=
0
;
xBlogTopic.CheckInTime
=
DateTime.Now;
xBlogTopic.Status
=
1
;
xBlogTopic.MemberID
=
Convert.ToInt32(blogid);
xBlogTopic.Tags
=
""
;
xBlogTopic.BlogSystemTypeID
=
null
;
xBlogTopic.Score
=
0
;
if
(
!
string
.IsNullOrEmpty(post.categories[
0
]))
{
foreach
(CategoryInfo info
in
getCategories(blogid, username, password))
{
if
(info.title
==
post.categories[
0
])
{
xBlogTopic.BlogKindID
=
int
.Parse(info.categoryid);
break
;
}
}
}
xBlogTopic.BastTime
=
null
;
BlogTopicSystem.Instance.Create(xBlogTopic);
return
xBlogTopic.BlogTopicID.ToString();
}
return
"
0
"
;
}
查看全文
相关阅读:
kill一个pthread_test.bin测试程序主线程、子线程退出kernel flow
signal bit operation
pthread
信号发送处理流程
sdcardfs
node小贴士03
node小贴士02
node小贴士01
siteserver cms 搜索功能
语法的高亮显示
原文地址:https://www.cnblogs.com/nasa/p/634093.html
最新文章
maven项目pom.xml解析
linuix查端口
解决FastJson循环引用的问题
什么时候使用Get请求/POST请求?
PO,BO,VO,DTO,POJO,DAO,DO是什么?
最大公约数与最小公倍数
hdu2063 过山车(二分图基础)
今年暑假不AC
最短路相关
Finding the Order(数学+思维)
热门文章
日常训练(1)
数字比较(牛客网周练)
Lucas定理(卢卡斯定理)
博弈论相关
乘法逆元
mybatis_1简介、优点
selinux misc
kernel timer misc
kernel log buf dump function kmsg_dump_get_buffer()
files_struct/fdtable解析
Copyright © 2011-2022 走看看