Use the rich functions in VB. NET directly in the C # program
Source: Internet
Author: User
Add a reference to Microsoft. VisualBasic. dll in the C # project #ProgramDirectly use the rich functions in VB. NET
C: \ windows \ Microsoft. NET \ framework \ v1.1.4322 \ Microsoft. VisualBasic. dll 1 // Command Line Compilation: CSC/R: Microsoft. VisualBasic. dll test. CS
2
3 // If Visual Studio. net ide is used, add references to the project as follows:
4 // Open [Solution Explorer], right-click the project name, and select [add reference].
5 // Select the Microsoft Visual Basic. Net runtime component from the list.
6
7 Using Microsoft. VisualBasic;
8
9 Class Test
10 {
11 Static Void Main ()
12 {
13 String S = " [Shineboy1219.cnblogs.com] " ;
14 System. Console. writeline (s );
15 S = Strings. strconv (S, vbstrconv. Wide, 0 ); // Halfwidth to fullwidth
16 S = Strings. strconv (S, vbstrconv. traditionalchinese, 0 ); // Simplified to traditional Chinese
17 System. Console. writeline (s );
18 S = Strings. strconv (S, vbstrconv. propercase, 0 ); // Uppercase letters
19 S = Strings. strconv (S, vbstrconv. Narrow, 0 ); // Fullwidth to halfwidth
20 S = Strings. strconv (S, vbstrconv. simplifiedchinese, 0 ); // Traditional to simplified
21 System. Console. writeline (s );
22 }
23 }
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.