1. F12:转到定义;Shift+F12:转到引用
创新互联公司为客户提供专业的成都网站建设、做网站、程序、域名、空间一条龙服务,提供基于WEB的系统开发. 服务项目涵盖了网页设计、网站程序开发、WEB系统开发、微信二次开发、手机网站制作等网站方面业务。
2. F5:启动;Ctrl+F5:开始执行(不调试);Shift+F5:停止调试
3. F7:查看代码;Shift+F7:查看视图设计器
4. Ctrl+Alt+L:解决方案资源管理器
5. Ctrl+Alt+J:对象浏览器
6. F4:显示属性窗口
7. Ctrl+Alt+X:工具箱
8. Ctrl+Alt+C类视图
9. Alt+Enter:查看属性
10.F10:逐过程调试
11.F11:逐语句调试
12.Ctrl+B:新断点
13.Ctrl+Shift+F9:清除所有断点
14.Ctrl+Shift+B生成解决方案
15.Shift+Alt+Enter:全屏
16.大纲显示:Ctrl+M, Ctrl+M:切换大纲显示展开;Ctrl+M, Ctrl+L:切换所有大纲显示;Ctrl+M,Crtl+P停止大纲显示;Ctrl+M, Ctrl+O:折叠到定义
17.智能感知:Ctrl+J:列出成员;Ctrl+Shift+空格:参数信息; Ctrl+K,Ctrl+I:快速信息;Alt+右箭头键:完成单词
DataTable dt;//假设 dt的第一列存储的就是这个str1_1,str2_1,str3_1,str4_1,则
foreach(DataRow dr in dt.Rows)
{
String s=dr[0].ToString();
String[] strs=s.split('_');//得到 str1,1 形式的数组(str2,1 str3,1 str4 ,1 )
String s2=strs[0];//取数组第一个,如 str1,str2,str3,str4 等
String[] strs2=s2.split('r');//得到st,1形式的数字
String 结果=strs2[1];//取第一个,得到如 1,2,3,4等结果就是lz需要的
}
本来可以用简单的dos命令的,但是影射成功与否返回不理想,建议用API,见下面
Module LocalNetConnect'模块,直接复制即可
Public Declare Function WNetAddConnection2 Lib "mpr.dll" Alias "WNetAddConnection2A" (ByRef lpNetResource As NETRESOURCE, ByVal lpPassword As String, ByVal lpUserName As String, ByVal dwFlags As Integer) As Integer
Public Declare Function WNetCancelConnection2 Lib "mpr.dll" Alias "WNetCancelConnection2A" (ByVal lpName As String, ByVal dwFlags As Integer, ByVal fForce As Integer) As Integer
Public Structure NETRESOURCE
Dim dwScope As Integer
Dim dwType As Integer
Dim dwDisplayType As Integer
Dim dwUsage As Integer
Dim lpLocalName As String
Dim lpRemoteName As String
Dim lpComment As String
Dim lpProvider As String
End Structure
Public Function netconnect(ByVal localDrive As String, ByVal sharePath As String, ByVal userName As String, ByVal UserPassword As String) As Boolean
Dim NetR As New NETRESOURCE
Dim ErrInfo As Integer
NetR.dwScope = 2
NetR.dwType = 1
NetR.dwDisplayType = 3
NetR.dwUsage = 1
'设置驱动器
NetR.lpLocalName = localDrive
'设置远程端口名字
NetR.lpRemoteName = sharePath
'设置连接
ErrInfo = WNetAddConnection2(NetR, UserPassword, userName, 1)
If ErrInfo = 0 Then
Return True
Else
Return False
End If
End Function
Public Function netdisconnect(ByVal localDrive As String) As Boolean
Dim ErrInfo As Integer
ErrInfo = WNetCancelConnection2(localDrive, 1, False)
If ErrInfo = 0 Then
Return True
Else
Return False
End If
End Function
End Module
‘调用
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'这里是映射调用,administrator为用户名,根据实际用户名
’如果将“Z:”设置为空就不会网络盘映射但是已经和172.26.120.47联机了(返回真时成立)。
If netconnect("Z:", "\\172.26.120.47\c$", "administrator", "局域网电脑实际密码") = True Then
MsgBox("success")
Else
MsgBox("Faile")
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click'这里是取消映射
If netdisconnect("Z:") = True Then
MsgBox("success")
Else
MsgBox("Faile")
End If
End Sub
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As String, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
改为
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As String, ByVal wMsg As integer, ByVal wParam As integer , ByVal lParam As String) As integer
再试试,
可能你的声明使用vb6。0 复制过来的,long 全部改成integer