精华内容
下载资源
问答
  • 利用activeX实现matlab和vb的混合编程-vb_matlab_activeX.rar  想要在vb里面直接执行matlab的代码吗?想省去编译dll文件的代码吧?  好的,activeX帮你实现这样的功能.   activeX简介: ActiveX部件是Microsoft...
  • VB的基本语法

    2018-06-07 15:38:00
    Option Explicit '强制声明变量...'Dim Opera,Operb,result '常量定义 'Const vbPI=3.14 'Opera=InputBox("please input a's value") 'Operb=InputBox("please input b's value") 'result=Opera+Operb 'Ms...

    Option Explicit '强制声明变量

     

    '变量的定义

    'Dim Opera,Operb,result

     

    '常量的定义

    'Const vbPI=3.14

    'Opera=InputBox("please input a's value")

    'Operb=InputBox("please input b's value")

    'result=Opera+Operb

    'MsgBox Opera&"+"&Operb&"="&result

    'MsgBox vbPI

     

     

    '内置换行

    'MsgBox "hello"&vbCrLf&"world"

     

    '字符串,大小写转换

    'Dim x

    'x=LCase("aBc") '小写

    'MsgBox x

    'x=UCase("Abcc") '大写

    'MsgBox x

     

    'StrComp 比较字符 如果字符相同则返回结果为0,否则为非0

    'Dim username,inun

    'username="zhangsan"

    'inun=InputBox("请输入用户名")

    ' If StrComp(username,inun) Then

    ' MsgBox "用户名不相同"

    ' Else

    ' MsgBox "相同"

    ' End If

    '字符长度

    ' Dim a

    ' a="maiziedu"

    ' MsgBox Len(a)

    '字符串替换

    'Dim astr

    'astr=Replace("hello,xiaoyu","hello","hi")

    'MsgBox astr

     

    '字符串分割

    'Dim teststr,teststrs

    'teststr="2.1.3"

    'teststrs=Split(teststr,".")

    ' MsgBox teststrs(0)

    ' MsgBox teststrs(1)

    ' MsgBox teststrs(2)

     

    转载于:https://www.cnblogs.com/fjy49/p/9150930.html

    展开全文
  • VB.NET支持四舍五入计算器,界面是仿Windows计算器风格,功能方面不算很强大,只是常规数学运算。不过本代码中注释非常多,对学习VB.NET编程相当有帮助。以下是编写计算器时一些参数定义:  Private sts As...
  • Sub 生成《数据质量检查》数据()' 生成《数据质量检查》数据 Macro' 宏由 chengyb 录制,时间: 2008-6-12Dim cmd As New ADODB.CommandDim rs As New ADODB.RecordsetDim conn As ConnectionDim result_str As ...

    Sub 生成《数据质量检查》数据()

    ' 生成《数据质量检查》数据 Macro

    ' 宏由 chengyb 录制,时间: 2008-6-12

    Dim cmd As New ADODB.Command

    Dim rs As New ADODB.Recordset

    Dim conn As Connection

    Dim result_str As String

    Dim i As Integer

    Dim index As Integer

    Dim index0 As Integer

    Dim index1 As Integer

    Dim k As Integer

    Dim col_name As String

    On Error GoTo errh

    'Windows("CEB_PLMS数据质量检查报告_Application_data(basel).xls").Activate

    'Sheets("目标_房贷").Select

    For i = 2 To 39

    col_name = Cells(i, 1)

    Debug.Print "开始检查" & col_name & "的数据"

    Set conn = OpenOraDSN("PLDB_10.1.18.246") '连接数据库字符串

    cmd.ActiveConnection = conn '建立命令类和数据库的连接

    cmd.CommandType = adCmdStoredProc '定义命令类型为执行存储过程

    cmd.CommandText = "checkdata_bak"  '执行存储过程的名字

    cmd.Parameters.Append _

    cmd.CreateParameter("col_name", adVarChar, adParamInput, 40, col_name) '添加执行存储过程的输入参数col_name为fi_acct_num

    cmd.Parameters.Append _

    cmd.CreateParameter("tab_name", adVarChar, adParamInput, 40, "vt_basel2_target") '添加执行存储过程的输入参数tab_name为vt_basel2_target

    cmd.Parameters.Append _

    cmd.CreateParameter("result_str", adVarChar, adParamOutput, 1000) '添加执行存储过程的输出参数result_str

    Set rs = cmd.Execute() '执行该存储过程

    result_str = cmd.Parameters("result_str").Value

    Debug.Print "sjk返回:" & result_str

    index = 1

    index0 = 1

    For k = 1 To 15  '截取字符串

    index1 = InStr(index0, result_str, "|")

    index = index1 - index0

    Cells(i, 5 + k) = Mid(result_str, index0, index)

    index0 = index1 + 1

    Next k

    Set rs = Nothing

    Set cmd = Nothing

    Debug.Print " 检查" & col_name & "数据结束"

    Next i

    errh:

    MsgBox Err.Description

    End Sub

    Function OpenOraDSN(Optional dsn As String = "PLDB_10.1.18.246") As Connection

    Dim iRet As Long, sDriver As String, sConn As String

    Dim sServer As String, sUser As String, sPass As String

    Dim c As Connection

    On Error GoTo errh

    sDriver = "Microsoft ODBC for Oracle"

    sConn = "DSN=" & dsn

    If SQLConfigDataSource(vbAPINull, ODBC_CONFIG_SYS_DSN, sDriver, sConn) = 0 Then

    MsgBox "没有创建名为" & dsn & "的数据源!" & vbCrLf & "点确定后将会引导你创建.(需要先安装oracle客户端,并配置好到数据库服务器的连接)", vbInformation

    sServer = InputBox("例如:odsptcs", "请输入Oracle配置的连接服务名", "PLDB_10.1.18.246")

    If sServer = "" Then End

    sUser = InputBox("例如:plms", "请输入Oracle用户名", "plms")

    If sUser = "" Then End

    sPass = InputBox("例如:plms", "请输入Oracle用户的密码", "plms")

    If sPass = "" Then End

    sConn = sConn & Chr(0) & "SERVER=" & sServer & Chr(0) & "UID=" & sUser & Chr(0) & "PWD=" & sPass

    iRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_SYS_DSN, sDriver, sConn)

    If iRet Then

    SaveSetting APPNAME, "DSN", dsn & ".UID", sUser

    SaveSetting APPNAME, "DSN", dsn & ".PWD", sPass

    MsgBox "数据源DSN创建成功!", vbInformation

    Else

    MsgBox "数据源DSN创建失败!", vbExclamation

    End

    End If

    Else

    sUser = GetSetting(APPNAME, "DSN", dsn & ".UID")

    sPass = GetSetting(APPNAME, "DSN", dsn & ".PWD")

    Do While sUser = ""

    sUser = InputBox("", "请输入Oracle用户名", "plms")

    Loop

    Do While sPass = ""

    sPass = InputBox("", "请输入Oracle用户的密码", "plms")

    Loop

    SaveSetting APPNAME, "DSN", dsn & ".UID", sUser

    SaveSetting APPNAME, "DSN", dsn & ".PWD", sPass

    End If

    Set c = New Connection

    c.Open "DSN=" & dsn, sUser, sPass

    Set OpenOraDSN = c

    Exit Function

    errh:

    MsgBox Err.Description, vbCritical, "打开数据库失败"

    End

    End Function

    展开全文
  • vb.net做俄罗斯方块

    2010-06-14 20:59:23
    Vb俄罗斯方块 基本功能全'声明一个整数常量Width,表示游戏界面横向小正方形数目,初始化为16 Public Const Width As Integer = 16 '声明一个整数常量Height,表示游戏界面横向小正方形数目,初始化为30 ...
  • 计基于VB.net计算器

    2014-05-07 16:08:20
    Public Class wk Dim Result As Double Dim Mem As Double Dim reg As Double Dim cNumber As Integer Dim ReDo As Boolean Dim cDecimal As Boolean Dim cClick As String
  • 在窗体画一个Command1,加入以下代码: Option Explicit Private Declare Function ChooseColor Lib “comdlg32.dll” Alias “ChooseColorA” (pChoosecolor As ChooseColor) As Long ...rgbResult As Long lp.

    在这里插入图片描述
    在窗体画一个Command1,加入以下代码:
    Option Explicit
    Private Declare Function ChooseColor Lib “comdlg32.dll” Alias “ChooseColorA” (pChoosecolor As ChooseColor) As Long
    Private Type ChooseColor
    lStructSize As Long
    hwndOwner As Long
    hInstance As Long
    rgbResult As Long
    lpCustColors As String
    flags As Long
    lCustData As Long
    lpfnHook As Long
    lpTemplateName As String
    End Type

    Private Sub Command1_Click()
    Dim WinColor As ChooseColor
    With WinColor
    .lStructSize = Len(WinColor)
    .hwndOwner = Me.hwnd
    .hInstance = App.hInstance
    .flags = 0
    .lpCustColors = String$(16 * 4, 0)
    End With
    If ChooseColor(WinColor) > 0 Then
    Me.BackColor = WinColor.rgbResult
    End If
    End Sub

    展开全文
  • http://www.cheapbuy.cn/tools/vbs/vskeyNothing.htm<br />3.vb 程序员指南源码下载地址,http://www.wrox.com/WileyCDA/Section/id-WROX_SEARCH_RESULT.html?query=vbscript<br />找到vb第三版,然后下载源码 ...
    展开全文
  • Dim result As String = "" Dim temp As String Dim temp2 As String If phone = "" Then result = phone Else If InStr(1, phone, Chr(10)) <> 0 Then temp = Left(phone, InStr(phone, Chr(10)) - 1) ...
  • 之前在java中一直用hashcode,到了VB.net中却找不到类似用法了,只好自己实现一下了,下面就是使用VB.net编写hashcode方法:Private Function hashcode(ByVal str As String)Dim chars() As Char = str....
  • 该楼层疑似违规已被系统折叠隐藏此楼查看此楼我来个超级,1000位只要0.4525秒:Subgetpi(OptionalByValnumsAsLong=10000)nums=nums/5DimmaxAsLong,laptimeAsSingle,result()AsStringDimi,jAsLong,dAsLong,t,g,r,kA...
  • vb数据库实例

    2012-06-30 20:01:05
    vb数据库实例,简单数据库实例应用 Dim intResult, i, intFind As Integer MyPath = "d:\" MyName = Dir(MyPath, vbDirectory) ReDim Mydirectory(intResult) MyName = Dir MyFile = "d:\1" & "\" & Form2.Text1....
  • QTP中经常使用的VB语句

    千次阅读 2015-01-27 16:56:11
    1.输出语句msgbox 输出需要返回数据值,加上""表示原样输出 ...result = MsgBox("Hello World!", vbOKOnly, "Greeting") MsgBox "Hello World!", vbOKOnly, "Greeting" 2.变量声明有两种方式——显
  • VB实现人事管理系统源代码+数据库SQL Server2014+程序说明。 一、本系统由以下对象组成: 1.窗体 (1)AddUser:添加用户; (2)Backup:数据库备份; (3)delete_staff:删除职员数据; (4)Login:系统...
  • VB简易计算器代码.docx

    2020-11-13 16:06:57
    这是一个简易计算器 VB代码下面是这个计算器界面有一个文本输入框和 16个按钮 Public Class Form1 Dim OperatorState As Integer Dim data1 As Integer Dim result As Integer Dim data2 As Integer 下面是 0~9...
  • VB简易计算器代码.doc

    2020-02-20 22:38:00
    这是一个简易计算器的VB代码下面是这个计算器界面有一个文本输入框和16个按钮 Public Class Form1 Dim OperatorState As Integer Dim data1 As Integer Dim result As Integer Dim data2 As Integer 下面是0~9十个...
  • 我想通过vb.net获取iperf测试返回数据,但是现在只能获取到dos内容,执行ping话,收到数据是正常,而iperf数据收不到,而且还会弹出dos窗口。麻烦帮忙看一下是怎么回事? 我代码: ``` Private ...
  • VB.NET 查找某路径下最新文件夹和最新TXT文件 任务:得到最新文件夹下最新TXT中字符串 Dim MyFullPath As String Dim MyFullPath1 As String '排序文件夹,找时间最新  result_camera = "" '清空...
  • VB6.0精简版

    2013-06-26 22:48:46
    VB6.0精简版 1.本站仅对原软件包“依样”打包,未做过任何改动,但不保证所提供软件或程序完整性和安全性。 1.Our website only pack up the original software without any altering, but we cannot guarantee ...
  • tmpString = StrConv(strBuffer, vbUnicode) tmpString = Left(tmpString, InStr(tmpString, vbNullChar) - 1) itemString = itemString & tmpString & "," result = VirtualFreeEx(pHandle, ...
  • 后台代码我是用的vb.net ``` Public Shared Function ajaxtext() As String Dim a = "1111111" Return a.ToString End Function ``` 实际结果就是response里都没有返回任何值,求大神帮忙看看
  • 西门子840D数控机床使用DHServer|Result实现NC程序管理参考SINUMERIK 840D/840Di HMI Programming Package Part 1 开发包。第10章Data Management按照给的VB例子,使用C++语言DDE直接和DHServer通讯,目前测试...
  • Dim result As Integer = LHD_Main(RawData(0), recttROI, rw, rh, HPHM(0), rectTmp, mnblePlate, i) 运行后在LHD_Main处报错: **尝试读取或写入受保护内存。这通常指示其他内存已损坏。** 求问怎么解决...
  • 我在vb.net语法为 Dim resulttable As New System.Data.DataTable oData = New MySql.Data.MySqlClient.MySqlDataAdapter(oQuery, oConn) 'oData = New OleDb.OleDbDataAdapter(SQL语法, oConn) oData....
  • 写了一个21点扑克牌程序,用VB.NET写,需要你找出其中bugs,尽可能多 找出,并写明错误原因 由于小弟写C#,对VB.NET实在不熟悉,还希望有经验前辈帮忙看看 小弟不胜感觉 代码一共有6个类 分别是 ...
  • Dim tempListener As TcpListener = CType(result.AsyncState, TcpListener) Dim client As TcpClient = tempListener.EndAcceptTcpClient(result) Dim bytes(1024) As Byte Dim data As String = ...
  •  reply = New RedisReply(RESPType.Integer, Convert.ToInt32(result.Substring(1, result.IndexOf(vbCrLf) - 1)))  Case "-"  reply = New RedisReply(RESPType.Error, result.Substring(1, result.IndexOf...

空空如也

空空如也

1 2 3 4 5 ... 8
收藏数 149
精华内容 59
关键字:

vb的result