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
"
;
}
查看全文
相关阅读:
css3实现轮播2
css3实现轮播1
读阮一峰ES6笔记4:字符串的新增方法
读阮一峰ES6笔记3:字符串的扩展
应用流策略与检查配置结果
配置流策略
配置流行为
配置流分类
"流量监管"和"流量整形"的区别
802.1p 优先级与内部优先级的映射关系
原文地址:https://www.cnblogs.com/nasa/p/634093.html
最新文章
Cross-compile GLib for Android
2018年买华硕笔记本 安装 Fedora 28,pcieport errors flood the journal
CrystaX NDK --- Native Development Kit for Android
fedora 28 中,WPS (PowerPoint,/usr/bin/wpp)不能启动
LeetCode 303. Range Sum Query
算法-动态规划
LeetCode 746. Min Cost Climbing Stairs
剑指offer 11.二进制中1的个数
剑指offer 10.矩形覆盖
剑指offer 9.变态跳台阶
热门文章
剑指offer 8.跳台阶
剑指offer 7.斐波那契数列
剑指offer 6.旋转数组的最小数字
剑指offer 5.用两个栈实现队列
浏览器--操作文件
浏览器--操作DOM
浏览器--浏览器对象
常用meta标签
CSS3 transition实现男女比例动态加载
数字滚动效果(CSS3 transition属性)
Copyright © 2011-2022 走看看