xml-rpc(2)-first demo_v2

xml-rpc(2)-first demo_v2         [XmlRpcMethod( " blogger.getUsersBlogs " , Description  =   " 获取博客信息 " )]
xml-rpc(2)-first demo_v2        
public  BlogInfo[] getUsersBlogs( string  appKey,  string  username,  string  password)
xml-rpc(2)-first demo_v2        
{
xml-rpc(2)-first demo_v2            BlogInfo[] infoarr 
= new BlogInfo[1];
xml-rpc(2)-first demo_v2            
for (int i = 0; i < 1; i++)
xml-rpc(2)-first demo_v2            
{
xml-rpc(2)-first demo_v2                Member member 
= GetUser(username, password);
xml-rpc(2)-first demo_v2                
if (member != null)
xml-rpc(2)-first demo_v2                
{
xml-rpc(2)-first demo_v2                    infoarr[i].url 
= GetAppPath() + "Blog/User/Default.aspx?UserName=" + HttpContext.Current.Server.UrlEncode(member.UserName);
xml-rpc(2)-first demo_v2                    infoarr[i].blogName 
= GetBlogSetting(Convert.ToInt32(member.MemberID)).BlogName;
xml-rpc(2)-first demo_v2                    infoarr[i].blogid 
= member.MemberID.ToString();
xml-rpc(2)-first demo_v2                }

xml-rpc(2)-first demo_v2            }

xml-rpc(2)-first demo_v2
xml-rpc(2)-first demo_v2            
return infoarr;
xml-rpc(2)-first demo_v2        }

xml-rpc(2)-first demo_v2
xml-rpc(2)-first demo_v2        [XmlRpcMethod(
" metaWeblog.getCategories " , Description  =   " 获取分类列表 " )]
xml-rpc(2)-first demo_v2        
public  CategoryInfo[] getCategories( string  blogid,  string  username,  string  password)
xml-rpc(2)-first demo_v2        
{
xml-rpc(2)-first demo_v2
xml-rpc(2)-first demo_v2            TList
<BlogKind> list = GetBlogKind(int.Parse(blogid));
xml-rpc(2)-first demo_v2
xml-rpc(2)-first demo_v2            CategoryInfo[] infoarr 
= new CategoryInfo[list.Count];
xml-rpc(2)-first demo_v2
xml-rpc(2)-first demo_v2            
for (int i = 0; i < infoarr.Length; i++)
xml-rpc(2)-first demo_v2            
{
xml-rpc(2)-first demo_v2                infoarr[i].categoryid 
= list[i].BlogKindID.ToString();
xml-rpc(2)-first demo_v2                infoarr[i].description 
= list[i].KindName;
xml-rpc(2)-first demo_v2                infoarr[i].htmlUrl 
= "";
xml-rpc(2)-first demo_v2                infoarr[i].rssUrl 
= "";
xml-rpc(2)-first demo_v2                infoarr[i].title 
= list[i].KindName;
xml-rpc(2)-first demo_v2            }

xml-rpc(2)-first demo_v2
xml-rpc(2)-first demo_v2            
return infoarr;
xml-rpc(2)-first demo_v2        }

xml-rpc(2)-first demo_v2
xml-rpc(2)-first demo_v2        [XmlRpcMethod(
" metaWeblog.newPost " , Description  =   " 发表日志 " )]
xml-rpc(2)-first demo_v2        
public   string  newPost( string  blogid,  string  username,  string  password, CookComputing.MetaWeblog.Post post,  bool  publish)
xml-rpc(2)-first demo_v2        
{
xml-rpc(2)-first demo_v2            Member member 
= GetUser(username, password);
xml-rpc(2)-first demo_v2            
if (member != null)
xml-rpc(2)-first demo_v2            
{
xml-rpc(2)-first demo_v2                BlogTopic xBlogTopic 
= new BlogTopic();
xml-rpc(2)-first demo_v2
xml-rpc(2)-first demo_v2                xBlogTopic.Title 
= post.title;
xml-rpc(2)-first demo_v2                xBlogTopic.Content 
= post.description;
xml-rpc(2)-first demo_v2                xBlogTopic.Weather 
= 0;
xml-rpc(2)-first demo_v2                xBlogTopic.Face 
= 1;
xml-rpc(2)-first demo_v2                xBlogTopic.CommentNum 
= 0;
xml-rpc(2)-first demo_v2                xBlogTopic.IsBast 
= 0;
xml-rpc(2)-first demo_v2                xBlogTopic.IsShow 
= 1;
xml-rpc(2)-first demo_v2                xBlogTopic.ComeFrom 
= username;
xml-rpc(2)-first demo_v2                xBlogTopic.Summary 
= "";
xml-rpc(2)-first demo_v2                xBlogTopic.IsTop 
= 0;
xml-rpc(2)-first demo_v2                xBlogTopic.LastIp 
= HttpContext.Current.Request.Url.Host;
xml-rpc(2)-first demo_v2                xBlogTopic.Hits 
= 0;
xml-rpc(2)-first demo_v2                xBlogTopic.CheckInTime 
= DateTime.Now;
xml-rpc(2)-first demo_v2                xBlogTopic.Status 
= 1;
xml-rpc(2)-first demo_v2                xBlogTopic.MemberID 
= Convert.ToInt32(blogid);
xml-rpc(2)-first demo_v2                xBlogTopic.Tags 
= "";
xml-rpc(2)-first demo_v2                xBlogTopic.BlogSystemTypeID 
= null;
xml-rpc(2)-first demo_v2                xBlogTopic.Score 
= 0;
xml-rpc(2)-first demo_v2                
if (!string.IsNullOrEmpty(post.categories[0]))
xml-rpc(2)-first demo_v2                
{
xml-rpc(2)-first demo_v2                    
foreach (CategoryInfo info in getCategories(blogid, username, password))
xml-rpc(2)-first demo_v2                    
{
xml-rpc(2)-first demo_v2                        
if (info.title == post.categories[0])
xml-rpc(2)-first demo_v2                        
{
xml-rpc(2)-first demo_v2                            xBlogTopic.BlogKindID 
= int.Parse(info.categoryid);
xml-rpc(2)-first demo_v2                            
break;
xml-rpc(2)-first demo_v2                        }

xml-rpc(2)-first demo_v2                    }

xml-rpc(2)-first demo_v2                }

xml-rpc(2)-first demo_v2                xBlogTopic.BastTime 
= null;
xml-rpc(2)-first demo_v2
xml-rpc(2)-first demo_v2                BlogTopicSystem.Instance.Create(xBlogTopic);
xml-rpc(2)-first demo_v2
xml-rpc(2)-first demo_v2                
return xBlogTopic.BlogTopicID.ToString();
xml-rpc(2)-first demo_v2            }

xml-rpc(2)-first demo_v2            
return "0";
xml-rpc(2)-first demo_v2        }

xml-rpc(2)-first demo_v2

你可能感兴趣的:(first)