How to call Visual Basic .NET run-time library members from Visual C#
2011-11-07 16:49
429 查看
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
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
相关文章推荐
- How to call the EnumJobs function from a Visual Basic .NET application
- How to launch Windows applications (Notepad) / Call Batch files from a C#/.NET console application.
- How to call webservices with ASP.NET at Run time?
- How to automate Microsoft Excel from Microsoft Visual C#.NET
- [导入]How can I run another application or batch file from my Visual C# .NET code?
- How To Use the ODBC .NET Managed Provider in Visual C# .NET and Connection Strings
- How to transfer data to an Excel workbook by using Visual C# 2005 or Visual C# .NET
- How to connect to MySQL database from Visual Studio VS2010 – problems with NET connectors
- How to connect to MySQL database from Visual Studio VS2010 – problems with NET connectors
- How to call C/C++ sytle function from C# solution?
- How to connect to MySQL database from Visual Studio VS2010 – problems with NET connectors
- How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET(利用Ado.net导出到Excel)
- How to use an ASP.NET application to query an Indexing Service catalog by using Visual Basic .NET
- How to run an existing SQL Server Agent Job from C#
- How to send raw data to a printer by using Visual C# .NET
- Summarize the steps how to create a .NET application[摘自Beginning Visual C# 2008]
- How To Transfer XML Data to Microsoft Excel 2002 by Using Visual C# .NET
- How to write an application that supports the Fast User Switching feature by using Visual Basic .NET or Visual Basic
- How to link with the correct C Run-Time (CRT) library
- How .NET run-time determines which member to invoke in a interface involving hiearchy