include QtCore/QCoreApplication
站在用戶的角度思考問題,與客戶深入溝通,找到寧晉網(wǎng)站設(shè)計(jì)與寧晉網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:網(wǎng)站建設(shè)、網(wǎng)站制作、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名與空間、網(wǎng)站空間、企業(yè)郵箱。業(yè)務(wù)覆蓋寧晉地區(qū)。
#include QAxObject
#include Windows.h
int main(int argc, char *argv[])
{
//OleInitialize(0);
//CoInitialize(0);
QCoreApplication a(argc, argv);
QAxObject *asdfg = new QAxObject("Excel.Application");
return a.exec();
}
很簡單,在end select前再多加一種情況case else return "XXXx",因?yàn)槟阒惶峁┝?-9這10種情況
Public Function Zuhe(ByVal qa As String) As String
Select Case qa
Case "0"
Return "1"
Case "1"
Return "3"
Case "2"
Return "4"
Case "3"
Return "6"
Case "4"
Return "2"
Case "5"
Return "8"
Case "6"
Return "9"
Case "7"
Return "7"
Case "8"
Return "5"
Case "9"
Return "0"
Case else
Return "XXXX"
End Select
End Function
因?yàn)閿?shù)據(jù)類型的不同,VB.NET調(diào)用系統(tǒng)API函數(shù)和VB6不太一樣,VB6是這樣:
Public?Declare?Function?SetWindowPos?Lib?"user32"?(ByVal?hwnd?As?Long,?ByVal?hWndInsertAfter?As?Long,?ByVal?X?As?Long,?ByVal?Y?As?Long,?ByVal?cx?As?Long,?ByVal?cy?As?Long,?ByVal?wFlags?As?Long)?As?Long
在VB.NET中是這樣調(diào)用:
DllImport("user32.dll",?SetLastError:=True)?_
Public?Shared?Function?SetWindowPos(ByVal?hWnd?As?IntPtr,?ByVal?hWndInsertAfter?As?IntPtr,?ByVal?X?As?Integer,?ByVal?Y?As?Integer,?ByVal?cx?As?Integer,?ByVal?cy?As?Integer,?ByVal?uFlags?As?SetWindowPosFlags)?As?Boolean
End?Function
參考:
注意:參數(shù)為動(dòng)態(tài)數(shù)組;
Private Function MyF(ByRef d() As Integer)
ReDim d(4, 13) As Integer
Dim i As Integer
Dim j As Integer
Dim n As Integer
Dim MyNum(4) As Integer
For i = 1 To 4
MyNum(i) = 0
Next i
Randomize
For i = 1 To 4
For j = 1 To 13
n = Int(Rnd * 4 + 1)
Do While MyNum(n) = 13
n = Int(Rnd * 4 + 1)
Loop
d(i, j) = n
MyNum(n) = MyNum(n) + 1
Next j
Next i
End Function
新聞標(biāo)題:vb.net洗牌函數(shù) java洗牌函數(shù)
分享路徑:http://m.rwnh.cn/article18/doshegp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站導(dǎo)航、ChatGPT、動(dòng)態(tài)網(wǎng)站、外貿(mào)建站、品牌網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)