Why kill App.Path?

  • Thread starter Thread starter Graham
  • Start date Start date
G

Graham

I've found that other thing that returns the assembly
executable but I don't need the file tacked on to the
path, just need the path. I don't want to always have to
write code to trim off the filename either...

Also, none of my friends want to try my new programs out
because they don't want to put the .NET framework on
their pc. I was reading that you guys killed the need for
runtime files with this version, so what exactly is
the .NET framework download that everyone needs to use my
programs?

Finally I am concerned about speed. I was led to believe
that .NET was so much faster then VB6. Yet, the install
took almost eternity, the programs I write in .NET load
slower as well as run operations significantly slower.
I'm sure the probelm is on my end but not sure where. My
only guess at this point is that I need to be running
Windows Server 2003 and so does everyone who wants to use
my programs and actually benefit from them. Could that be
the problem?
 
System.IO.Path has some methods to help you out. I also think there are
other ways of finding the codebase (try AppDomain.Current.BaseDirectory).

Well, if they don't want the .NET Framework on their PCs, then they'll be
stuck with using Windows XP or earlier for the rest of their lives. Pretty
much everything needs some kind of runtime (even older VB programs), so no,
"runtime requirements" were not killed.

Which specific operations are you seeing that are slower? In general, well
written .NET code can perform very well (sometimes faster than an app
written in C++ due to the memory management).

Thanks,
-mike
MVP
 
Your suggestion was exactly what I was looking for. You
are also probably right about the efficiency of my
applications being due to lack of good coding. So much
for me to learn and so little money. I am glad that I can
come here and get results.

Thank you,
Graham
 
On MSDN there are various performance documents for .NET. My biggest
suggestion for you if you are using VB.NET is to drop all VB language
functions. Use the .NET specific stuff instead.

For instance don't use the VB string functions like Mid and so on. Use the
String.XXX functions and the Math.Whatever functions.

For casting, use DirectCast instead of CType whenever possible.

And of course, make sure Option Explicit and Option Strict are on. These
make VB much, much better.

-mike
MVP
 
Back
Top