How to call Visual Basic .NET run-time library members from Visual C#

Add a Reference to the Visual Basic .NET Run-Time Library

  • In a Visual C# application, click the Project menu, and then click Add Reference.
  • In the Component Name list, click Microsoft Visual Basic .NET Runtime to add Microsoft.VisualBasic.dll.
  • At the top of the source file, add the following statement:
    using Microsoft.VisualBasic;

    Sample Code
    You can now use members of the Visual Basic .NET run-time library in Visual C#. The following code demonstrates how to use the IsNumeric function, which is a member of the Microsoft.VisualBasic.Information class:
    private void UseIsNumeric()
    {
    string s = "123";
    bool bResult1, bResult2;
    bResult1 = Information.IsNumeric(s);
    // bResult1 now equals true
    s = "Hello";
    bResult2 = Information.IsNumeric(s);
    // bResult2 now equals false;
    }

    This article was previously published on Microsoft Official Website.
    Link: http://support.microsoft.com/kb/325961/en-us?fr=1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值