Function GetMD5Hash(ByVal strToHash As String) As String Dim md5Obj As New MD5CryptoServiceProvider() Dim bytesToHash() As Byte = Encoding.ASCII.GetBytes(strToHash) bytesToHash = md5Obj.ComputeHash(bytesToHash) Dim strResult As New StringBuilder() For Each b As Byte In bytesToHash strResult.Append(b.ToString("x2")) Next Return strResult.ToString() End Function 使用方式:GetMD5Hash("需要加密的字符串")
' 定义一个名为“解析JSON”的子过程,并传递一个字符串类型参数 str Sub 解析JSON(ByVal str As String) ' 创建一个对象 ScriptObj 并将其设置为“MSScriptControl.ScriptControl”类的实例 Dim ScriptObj As Object ScriptObj = CreateObject("MSScriptControl.ScriptControl") ' 允许 UI 操作 ScriptObj.AllowUI = True ' 将脚本语言设置为 JavaScript ScriptObj.Language = "JavaScript" ' 向 ScriptObj 对象添加代码,该代码将变量 data 设置为传入的 JSON 字符串 str ScriptObj.AddCode("var data = " & str & ";
Imports System.Text.RegularExpressions ' 导入正则表达式命名空间 Imports System.Net ' 导入网络请求命名空间 Public Class Form1 ' 定义窗体类 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click ' 按钮1的点击事件处理程序 Dim url As String = TextBox1.Text ' 从文本框1获取输入的链接 Dim regex_domain As New Regex("^https:\/\/([\.\w-]+)\/.*$") ' 定义匹配域名的正则表达式对象 Dim regex_name As New Regex("\/g\/personal\/(\w+)\/") ' 定义匹配用户名的正则表达式对象 Dim regex_link As New Regex("\/
LaoDan
鱼头网络工作室