VB.NET conversion with C #

xiaoxiao2021-04-07  342

Recently, I have to modify the components written with C # to VB.NET. Since I used to be very familiar with VB, when I was modified, I found that there were many corresponding writes to check, there was no comparison table, I checked it very much, I have been consulted. a bit

Site, ask if there is any relationship table of VB.NET and C # corresponding grammar,

Thinking of the following address:

http://www.harding.edu/user/fmccown/www/vbnet_csharp_comparison.html

VB.Net and C # Comparison

Considering that page is slow, I put it simultaneously to my article: Connection:

http://blog.joycode.com/ghj/posts/15091.aspx

Some tools for converting the conversion of VB.NET codes can see the following address:

http://authors.aspalliance.com/aldotnet/examples/translate.aspxhttp://www.kamalpatel.net/ConvertCSharp2VB.aspxhttp://www.ragingsmurf.com/vbcsharpconverter.aspxhttp://w1.311.telia. COM / ~ U31115556 / DESC / Programs.htmhttp: //expert.9cbs.net/expert/topic/1645/1645967.xml

I tried these converters, personal feelings the first http://authors.aspalliance.com/aldotnet/examples/translate.aspx? It is the best in these.

My experiment is to modify a paging component from the C # code to VB.NET code, this pagination component can be seen: http://www.microsoft.com/china/msdn/archives/library/dnaspp/html/pagerControls.asp

After the C # code is converted to the VB.NET code, I can use it slightly. The modification I did is mainly the following places:

1, VB.NET class, enumerate default is not public, there may be problems when converting.

2, the event trigger code is different. Such as the following code: C # is written as follows: protected virtual void onclick (Eventargs e) {if (click! = Null) {Click (this, e);}} VB.NET is written as follows: protected overridable sub-onclick (e as eventargs) RaiseEvent Click (ME, E) End Sub3, after conversion attribute information will make a mistake. If you have a comment, you will be wrong to put it in front of the comment.

If you need to convert from the C # code to VB code, it is strongly recommended that the tool, the general code, and the transition can be run, a complex code, a slight modification, it is possible. highly recommended.

转载请注明原文地址:https://www.9cbs.com/read-132560.html

New Post(0)