1. F12:轉(zhuǎn)到定義;Shift+F12:轉(zhuǎn)到引用
創(chuàng)新互聯(lián)公司為客戶提供專(zhuān)業(yè)的成都網(wǎng)站建設(shè)、做網(wǎng)站、程序、域名、空間一條龍服務(wù),提供基于WEB的系統(tǒng)開(kāi)發(fā). 服務(wù)項(xiàng)目涵蓋了網(wǎng)頁(yè)設(shè)計(jì)、網(wǎng)站程序開(kāi)發(fā)、WEB系統(tǒng)開(kāi)發(fā)、微信二次開(kāi)發(fā)、手機(jī)網(wǎng)站制作等網(wǎng)站方面業(yè)務(wù)。
2. F5:?jiǎn)?dòng);Ctrl+F5:開(kāi)始執(zhí)行(不調(diào)試);Shift+F5:停止調(diào)試
3. F7:查看代碼;Shift+F7:查看視圖設(shè)計(jì)器
4. Ctrl+Alt+L:解決方案資源管理器
5. Ctrl+Alt+J:對(duì)象瀏覽器
6. F4:顯示屬性窗口
7. Ctrl+Alt+X:工具箱
8. Ctrl+Alt+C類(lèi)視圖
9. Alt+Enter:查看屬性
10.F10:逐過(guò)程調(diào)試
11.F11:逐語(yǔ)句調(diào)試
12.Ctrl+B:新斷點(diǎn)
13.Ctrl+Shift+F9:清除所有斷點(diǎn)
14.Ctrl+Shift+B生成解決方案
15.Shift+Alt+Enter:全屏
16.大綱顯示:Ctrl+M, Ctrl+M:切換大綱顯示展開(kāi);Ctrl+M, Ctrl+L:切換所有大綱顯示;Ctrl+M,Crtl+P停止大綱顯示;Ctrl+M, Ctrl+O:折疊到定義
17.智能感知:Ctrl+J:列出成員;Ctrl+Shift+空格:參數(shù)信息; Ctrl+K,Ctrl+I:快速信息;Alt+右箭頭鍵:完成單詞
DataTable dt;//假設(shè) dt的第一列存儲(chǔ)的就是這個(gè)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 形式的數(shù)組(str2,1 str3,1 str4 ,1 )
String s2=strs[0];//取數(shù)組第一個(gè),如 str1,str2,str3,str4 等
String[] strs2=s2.split('r');//得到st,1形式的數(shù)字
String 結(jié)果=strs2[1];//取第一個(gè),得到如 1,2,3,4等結(jié)果就是lz需要的
}
本來(lái)可以用簡(jiǎn)單的dos命令的,但是影射成功與否返回不理想,建議用API,見(jiàn)下面
Module?LocalNetConnect'模塊,直接復(fù)制即可
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
'設(shè)置驅(qū)動(dòng)器
NetR.lpLocalName?=?localDrive
'設(shè)置遠(yuǎn)程端口名字
NetR.lpRemoteName?=?sharePath
'設(shè)置連接
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
‘調(diào)用
Private?Sub?Button1_Click(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?Button1.Click
'這里是映射調(diào)用,administrator為用戶名,根據(jù)實(shí)際用戶名
’如果將“Z:”設(shè)置為空就不會(huì)網(wǎng)絡(luò)盤(pán)映射但是已經(jīng)和172.26.120.47聯(lián)機(jī)了(返回真時(shí)成立)。
If?netconnect("Z:",?"\\172.26.120.47\c$",?"administrator",?"局域網(wǎng)電腦實(shí)際密碼")?=?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 復(fù)制過(guò)來(lái)的,long 全部改成integer