诗情寻知己
揽几缕、轻挽起,暮暮朝朝与君语。
   Private Sub ChangeObjectValues(Object1 As Object)
        Dim propertyInfo() As PropertyInfo = Object1.GetType().GetProperties((BindingFlags.Public Or BindingFlags.Instance Or BindingFlags.DeclaredOnly))
        For Each propertyItem As System.Reflection.PropertyInfo In propertyInfo
            If propertyItem.PropertyType.Name = "String" Then
                Dim strvalue As String = EscapeValues(propertyItem.GetValue(Object1, Nothing))
                propertyItem.SetValue(Object1, strvalue, Nothing)
            End If
        Next
    End Sub

    Private Function EscapeValues(str_value As Object) As String
        Dim str As String = str_value 
        str = Regex.Replace(str, "[\x00-\x08\x0b\x0c\x0e-\x1f\x26]", "")

        'str = str.Replace("<", "<")
        'str = str.Replace(">", ">")
        'str = str.Replace("&", "&")
        'str = str.Replace("'", "'")
        'str = str.Replace("""", """)
        'str = str.Replace("", "")
        'str = str.Replace("", "")
        'str = str.Replace("", "")
        Return str
    End Function

  

posted on 2022-07-20 08:00  诗情寻知己  阅读(51)  评论(0编辑  收藏  举报