vb.net msdn 哪有下载vb.net的MSDN都在微软的网站上,因为微软每天都在更新MSDN的内容,当然也有离线版,不过容量太大(10多G),不建议安装,如果要装的话,请参考:
如何用C#实现自动输入如数字,字母;自动按键QQ自动登陆,其实很简单,执行QQ.EXE后面加参数就行了,如下
"D:\Program Files\Tencent\cm\QQ.exe" /START QQUIN:QQ帐号 PWDHASH:这里是密码加密串 /STAT:40(40是隐身,41是在线)
要写的就是如何得到那串加密串,给个函数你
public static string HashBase64(string str)
{
byte[] result = new byte[str.Length];
try
{
MD5 md = new MD5CryptoServiceProvider();
result = md.ComputeHash(System.Text.Encoding.UTF8.GetBytes(str));
return Convert.ToBase64String(result);
【msdnvb.net的简单介绍】}
catch
{
return "";
}
}
QQ路径可以读注册表[HKEY_LOCAL_MACHINE\SOFTWARE\TENCENT\QQ\Install]中
下面是一串完整的 , 用BAT执行也行,在桌面搞个快捷方式也行
"D:\Program Files\Tencent\cm\QQ.exe" /START QQUIN:37***26 PWDHASH:6ZoYxC**********eJIuAw== /STAT:40
VB.NET HttpWebRequest根据MSDN写法获取不到COOKIE,有的可以但不完整嘿嘿,试试下面这个api
Private Const INTERNET_COOKIE_HTTPONLY As Integer = H2000
SuppressUnmanagedCodeSecurity, SecurityCritical, DllImport("wininet.dll", EntryPoint:="InternetGetCookieExW", SetLastError:=True, ExactSpelling:=True)
Friend Function InternetGetCookieEx([In] Url As String, [In] cookieName As String, Out cookieData As StringBuilder, [In], Out ByRef pchCookieData As UInteger, flags As UInteger, reserved As IntPtr) As Boolean
End Function
''' summary
''' 获取webbrowser登录成功后的cookie,需要带上登录成功后的URL
''' /summary
''' param name="url"/param
''' returns/returns
SecurityCritical()
Public Function GetCookie(url As String) As String
Dim size As UInteger = 0
Dim sb As New StringBuilder
If InternetGetCookieEx(url, vbNullString, Nothing, size, INTERNET_COOKIE_HTTPONLY, IntPtr.Zero) Then '-- this always returns false
If size = 0 Then
Return Nothing
End If
sb = New StringBuilder(Convert.ToInt32(size) + 1)
If Not InternetGetCookieEx(url, vbNullString, sb, size, INTERNET_COOKIE_HTTPONLY, IntPtr.Zero) Then
Return Nothing
End If
End If
Dim lastErrorCode = Marshal.GetLastWin32Error '-- 259
Return sb.ToString()
End Function
另外 , 再给你一个函数
''' summary
''' 字符串型的cookie转换成cookie型的cookiecollection
''' /summary
''' param name="cookieStr"/param
''' param name="cookie"/param
''' param name="domain"/param
Public Sub StringToCookie(ByVal cookieStr As String, ByRef cookie As CookieContainer, ByVal domain As String)
cookie = New CookieContainer()
Debug.Print($"过程:{New StackTrace().GetFrame(0).GetMethod.Name} 转换cookie开始")
Try
Dim cookstr As String() = cookieStr.Split(";"c)
Dim cookieName As String = ""
Dim cookieValue As String = ""
For Each str As String In cookstr
cookieName = str.Substring(0, InStr(str, "=") - 1).Trim()
cookieValue = https://www.04ip.com/post/str.Substring(InStr(str,"="), str.Length - InStr(str, "=")).Trim()
Dim ck As New Cookie(cookieName, cookieValue)
'Debug.Print($"{cookieName} = {cookieValue}")
ck.Domain = domain
cookie.Add(ck)
Next
Debug.Print($"过程:{New StackTrace().GetFrame(0).GetMethod.Name} 转换cookie成功")
Catch ex As Exception
Debug.Print($"过程:{New StackTrace().GetFrame(0).GetMethod.Name} {ex.StackTrace.ToString()}")
Finally
Debug.Print($"过程:{New StackTrace().GetFrame(0).GetMethod.Name} 转换cookie结束")
推荐阅读
- 电脑软件怎么选择d盘,电脑软件怎么选择d盘还是c盘
- chatgpt怎么收费,ChatGPT怎么收费
- 摸摸鱼推荐游戏恋爱养成,摸摸鱼游戏分享
- 水军直播文案的简单介绍
- vb.net就业前景 vb net从入门到精通
- 怎么下载歌曲在硬盘里面,怎么下载歌曲到移动硬盘
- javascript是什么样技术,javascript干什么的
- 孩子益智类体能游戏,孩子益智类体能游戏教案
- python交叉熵函数 numpy 交叉熵