Working around VB .NET
Do you know how amazing VB .NET is? When i was programming in C it took me so much time to google and figure out solution. VB .NET was the other way round! Google "what do you want" + "in vb .net" and you got what you want instantly.
I wanted to check for the file extension so i googled and i got the result and towards my amazement the outcome came out pretty well!
Back when i was programming in C i have to use
[code]
if(strstr(filename, ".exe") != 0)
[/code]
or probably you'll use this!
[code]
if(filename[strlen(filename) - 1] != 'e' &&
filename[strlen(filename) - 2] != 'x' &&
filename[strlen(filename) - 3] != 'e' &&
filename[strlen(filename) - 4] != '.')
[/code]
but in VB .NET (oh the wonders in the world), you'll just
[code]
if Path.GetExtension(filename) = ".exe"
[/code]
damn it... how i wished i learnt VB .NET in depth! - Not. Well although VB .NET provides us with so much simplicity i still prefer C as it was my first language and the one i mastered well the most. However i'm learning VB .NET for the sake of its GUI :) Big thanks to those that brought VB .NET to how it is today!
Currently have 0 comments: