用java开发校内网小工具 (八) 

作者: ldsea 分类: 程序生活 发布时间: 2008-02-23 12:48

[code]String blogId = ldFilter.getBlogId(url);
        try{
         PostMethod   postEditBlog = new PostMethod("http://blog.xiaonei.com/EditEntry.do");
         StringPart title = new StringPart("title",strTitle);
         title.setCharSet("utf-8");
         StringPart body = new StringPart("body",strBody);
         body.setCharSet("utf-8");
         StringPart blogControl = new StringPart("blogControl","99");
         StringPart blog_pic_id = new StringPart("blog_pic_id","");
         StringPart pic_path = new StringPart("pic_path","");
         StringPart id = new StringPart("id",blogId);
         StringPart relative_optype = new StringPart("relative_optype","publisher");
         StringPart[] parts = {title,body,blogControl,blog_pic_id,pic_path,id,relative_optype};
         postEditBlog.setRequestEntity(new MultipartRequestEntity(parts,postEditBlog.getParams()));
         httpClient.executeMethod(postEditBlog);
        // System.out.println(postEditBlog.getStatusLine());
         postEditBlog.releaseConnection();
        }
        catch(Exception e)
        {
            System.out.println("编辑日志出现错误");
        }[/code]
[size=4]前一段时间一直没有写编辑日志的功能,觉得没什么用,昨天为了测试代码,才觉得编辑日志很重要,今天上午就索性编出来了,这样终于把第一阶段的所有功能都实现了[/size][emot]grin[/emot]

[img][attach]34[/attach][/img]