• 测试我用WLW在CSDN上的第一篇博客


    CSDN上写博客让人很纠结,因为很慢,而且会丢失信息,这让我很郁闷,为了这个我都想将CSDN上的博客搬家到CNBLOG上去了。但是发现使用WLW既可以写CSDN的博客,也可以写CNBLOG的博客,我有想试一下,如果可以的话就不搬家了。我还是喜欢CSDN的环境。

    下面测试代码能否插入。这里使用了插件Paste AS VS Code,而不是使用WindowsLiveWriter.SourceCode.dll这个插件。

    Code Snippet
    1. Private Sub cmdImportUsers_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdImportUsers.Click
    2.          Dim xmlDoc As New XmlDocument
    3.          xmlDoc.LoadXml(txtUserXML.Text)
    4.          ' update the user record in the database
    5.          Dim responseBuilder As StringBuilder = New StringBuilder()
    6.          For Each xmlItem As XmlElement In xmlDoc.SelectNodes("/Users/User")
    7.  
    8.              Dim oUserInfo As New UserInfo
    9.              oUserInfo.PortalID = 0
    10.              oUserInfo.Membership.Username = GetXmlItemValue(xmlItem, "Username")
    11.              oUserInfo.Username = GetXmlItemValue(xmlItem, "Username")
    12.              oUserInfo.Profile.FirstName = GetXmlItemValue(xmlItem, "FirstName")
    13.              oUserInfo.FirstName = GetXmlItemValue(xmlItem, "FirstName")
    14.              oUserInfo.Profile.LastName = GetXmlItemValue(xmlItem, "LastName")
    15.              oUserInfo.LastName = GetXmlItemValue(xmlItem, "LastName")
    16.              oUserInfo.Profile.Unit = GetXmlItemValue(xmlItem, "Unit")
    17.              oUserInfo.Profile.Street = GetXmlItemValue(xmlItem, "Street")
    18.              oUserInfo.Profile.City = GetXmlItemValue(xmlItem, "City")
    19.              oUserInfo.Profile.Region = GetXmlItemValue(xmlItem, "Region")
    20.              oUserInfo.Profile.PostalCode = GetXmlItemValue(xmlItem, "PostalCode")
    21.              oUserInfo.Profile.Country = GetXmlItemValue(xmlItem, "Country")
    22.              oUserInfo.Profile.Telephone = GetXmlItemValue(xmlItem, "Telephone")
    23.              oUserInfo.Membership.Email = GetXmlItemValue(xmlItem, "Email")
    24.              oUserInfo.Email = GetXmlItemValue(xmlItem, "Email")
    25.              oUserInfo.Membership.Approved = True
    26.              oUserInfo.AffiliateID = Null.NullInteger
    27.              oUserInfo.Membership.Password = GetXmlItemValue(xmlItem, "Password")
    28.          Dim createStatus As UserCreateStatus = UserController.CreateUser(oUserInfo)
    29.  
    30.          '    If createStatus = UserCreateStatus.Success Then
    31.          '    responseBuilder.AppendLine(String.Format("User '{0}' created successfully", oUserInfo.Username))
    32.  
    33.          '    Else
    34.          '    responseBuilder.AppendLine(String.Format("User '{0}' creation failed: {1}", oUserInfo.Username, [Enum].GetName(GetType(UserCreateStatus), createStatus)))
    35.  
    36.          'End If
    37.          '只输出导入不成功的用户。
    38.          If createStatus <> UserCreateStatus.Success Then
    39.              responseBuilder.AppendLine(String.Format("User '{0}' creation failed: {1}", oUserInfo.Username, [Enum].GetName(GetType(UserCreateStatus), createStatus)))
    40.          End If
    41.  
    42.          Next
    43.          txtUserXML.Text = responseBuilder.ToString()
    44.      End Sub
    然后是测试图片能够上传

    02175993

    作者:xwdreamer
    欢迎任何形式的转载,但请务必注明出处。
    分享到:
  • 相关阅读:
    oracle中to_date详细用法示例(oracle日期格式转换)
    两个日期类型的值相减转化成秒
    oracle trunc 函数处理日期格式
    Oracle按时间查询条件
    Oracle获取两时间的相差天数
    杂 在tabControl设置上的小点
    C#基础 类(class)
    杂 关于tabControl
    未解,关于RichTextBox导致的前端问题
    添加Resources语言切换注意
  • 原文地址:https://www.cnblogs.com/xwdreamer/p/2297127.html
Copyright © 2020-2023  润新知