I haven't written blog for a long time, and the translation work has not continued to finish the software designer. I hope that there will be time to continue that work, I'm too busy recently. At the end, there is a bunch of things to see, the design Week also has a blueprint, the oil tank is really a tossing me ~ If some netizens want to continue translation, Please contact me. I can do school to work. Thank you, I was in the MSDN community a few days ago, because I also used the trivial matter with MSN space, and MSN often has some problems, so I found out below, I wanted to write a client, then Local editing storage, automatically upload. Ha ha ~ wait for the test, I have to try it, I can contact me if I want to develop together. Ha ha ~ first turn the bottom of Dongdong ~ Interested friends can see, the code is very clear, it is easy to understand ~
Metaweblogapi and MSN Spaces MSN Spaces Metaweblog API, Version 1.00
Metaweblogapi VisualBasic .NET Code Sample Imports System
Imports cookcomputing.xmlrpc
Imports system.net
Namespace Metaweblogapi
'/
'/ This struct represents information about a user's blog.
'/ summary>
Structure Userblog
Public URL AS STRING
Public BlogID as string
Public blogname as string
End structure
'/
'/ This struct represents information about a user.
'/ summary>
Structure UserInfo
Public URL AS STRING
Public BlogID as string
Public blogname as string
Public firstname as string
Public Lastname As String
Public email as string
Public Nickname As String
End structure
'/
'/ This struct represents the information about a category That Could Be returned by the
'/ getcategories () method.
'/ summary>
Structure Category
Public Description As String
Public Title As String
End structure
'/
'/ This struct represents the information about a post what could be returned by the
'/ editpost (), getRecentPosts () and getpost () Methods.
'/ summary>
Structure Post
Public Datecreated as datetime
Public Description As String
Public Title As String
Public Postid As String
Public categories () AS STRING
End structure
'/
'/ This class can be used to programatically intect with a weblog on
'/ MSN Spaces Using The MetaWeblog API.
'/ summary>
Class msnspacesmetaweblog
Inherits XMLRPCCCLIENTPROTOCOL
'/
'/ Returns the MOST DRAFT AND NON-DRAFT Blog Posts Sorted in Descending Order by Publish Date.
'/ summary>
'/ this kind of be the string myblog, Which indeicates That the post is being created in the user's blog. param>
'/ The name of the user's space. param>
'/ The user's secret word. param>
'/ The number of posts to return. The maximum value is 20. param>
'/
Public property getRecentPosts (() AS POST ()
End Property
)
END FUNCTION
'/
'/ Posts a new entry to a blog.
'/ summary>
'/ this kind of be the string myblog, Which indeicates That the post is being created in the user's blog. param>
'/ The name of the user's space. param>
'/ The user's secret word. param>' / a struct representing the content to update. param>
'/ if false, this is a draft post. param>
'/
Public property newpost (() AS STRING
End Property
)
END FUNCTION
'/
'/ Edits an existing entry on a blog.
'/ summary>
'/ The id of the post to update. param>
'/ The name of the user's space. param>
'/ The user's secret word. param>
'/ a struct representing the content to update. param>
'/ if false, this is a draft post. param>
'/
Public property editpost (() AS Boolean
End Property
)
END FUNCTION
'/
'/ Deletes a post from the blog.
'/ summary>
'/ this value is ignored. param>
'/ The id of the post to update. param>
'/ The name of the user's space. param>
'/ The user's secret word. param>
'/ a struct representing the content to update. param>' / this value is ignored. param>
'/
Public property deletepost (() as boolean
End Property
)
END FUNCTION
'/
..
'/ summary>
'/ this value is ignored. param>
'/ The id of the post to update. param>
'/ The name of the user's space. param>
'/
'/ The Array Will Contain A Maximum of One Struct, Since A User Can Only Blog. Return>
Public property getUsersblogs (() as userblog ()
End Property
)
END FUNCTION
'/
'/ Returns basic user info (name, e-mail, userid, and so on).
'/ summary>
'/ this value is ignored. param>
'/ The id of the post to update. param>
'/ The name of the user's space. param>
'/
'/ EACH STRUCT WILL Contain The Following Fields: Nickname, Userid, URL, E-Mail,
'/ lastname, and firstname. returns>
Public property getuserinfo (() AS UserInfo
End Property
)
END FUNCTION
'/
'/ Returns a specific entry from a blog.
'/ summary>
'/ The id of the post to update. param>
'/ The name of the user's space. param>
'/ The user's secret word. param>
'/
Public property getpost (() AS POST
End Property
)
END FUNCTION
'/
'/ Returns the list of categories That Have Been Used In The Blog.
'/ summary>
'/ this kind of be the string myblog, Which indeicates That the post is being created in the user's blog. param>
'/ The name of the user's space. param>
'/ The user's secret word. param>
'/
'/ Each Category Struct Will Contain A Description Field That Contains The name of the category. Returns>
Public property getcategories (() as category ()
End Property
)
END FUNCTION
'/
'/ The main entry point for the application.
'/ summary>
Shared Sub Main (Byval Args () AS STRING
DIM MW as msnspacesmetaweblog = new msnspacesmetaweblog () DIM Username as string = "! Space3 * pqc3 * o00y0!"
Dim Password As String = "MysecretWord"
Mw.credentials = new networkcredential (username, password)
Try
'Space3PQC3YUO00Y0
DIM POST AS Post = New Post ()
Post.categories = new string ()
{
Test Posts
}
Post.title = "Tets 3"
Post.description = "this is my 3rd test POST"
Post.datecreated = datetime.now
DIM ID as string = mw.newpost ("Myblog", UserName, Password, Post, True
Post.title = "TEST 3 (Test 3"
MW.EDITPOST (ID, Username, Password, Post, True)
Post = MW.GETPOST (ID, Username, Password)
Console.writeline ("Just Edited The Post with Title '{0}' AT '{1}'", post.title, post.datecreated
'Display List of categories Used on the blog * /
Dim categories () as category = mw.getcategories ("Myblog", UserName, Password)
DIM C As Category
For Each C in Categories
Console.writeline ("Category: {0}", C.Description)
NEXT
'Display Title of the Ten Most Recent POSTS. * /
DIM Posts () as post = mw.getRecentPosts ("Myblog", Username, Password, 10)
DIM P AS POST
For Each P in Posts
Console.writeline ("Post Title: {0}", P.TITLE)
NEXT
MW.DeletePost (String.empty, ID, Username, Password, True)
Console.writeline ("The Post Entitled '{0}' Has Been Deleded", Post.Title)
'GET INFO ON User's Blogs * /
DIM blogs () as userblog = mw.getusersblogs (string.empty, username, password)
DIM B AS Userblog
For Each B in Blogsconsole.writeline ("The Url of '{0}' IS {1}", B.Blogname, B.URL)
NEXT
'Get info on the user * /
DIM User as userinfo = mw.getuserinfo (String.empty, Username, Password)
Console.Writeline ("{0} {1} is the Owner of the space whose url is {3}", user.firstname, user.lastname, user.email, user.URL)
Catch XRFE as XMLRPCFAULTEXCEPTION
Console.writeline ("Error: {0}", XRFE.Faultstring)
END TRY
Console.readline ()
End Sub
END CLASS
End Namespace