ehh any one mind if I ask these kind of stupid questions?:D
What should I use instead of App.Path in VB.NET?:)
Printable View
ehh any one mind if I ask these kind of stupid questions?:D
What should I use instead of App.Path in VB.NET?:)
System.Reflection.Assembly.GetExecutingAssembly.Location
and use the .ToString method to add into a string
You may find it easier to import the System.Reflection.Assembly namespace
hehe, too many dots, tnx:)
I kinda forgot the difference of Imprts and Inherits, can you plz tell me the difference :)
When an object inherits something it makes use of another objects methods. For example, if you create a class and build some custom properties and methods, your other code can utilize those methods/properties plus the GetType method, but you have no way explicitly removing it from memory. If you tell your class to Inherits System.Windows.Forms.Form
you Inherit the System.Windows.Forms.Form's objects ability to destroy itself along with several other methods.
Once you put an inheritence statement like the one above in your class you will see the Dispose() method available when you instanciate your class.
Importing a namespace is just a way to save typing. You could theoretically build a SQL Server data-driven app, for example, without importing System.Data.SqlClient, but everytime you call up an ADO.NET object you would have to type somthing like
Dim sConn as New System.Data.SqlClient.SqlConnection or Dim sCmd as New System.Data.Client.SqlCommand vs Dim sCmd as New SqlCommand("SELECT....
It also makes your code easier to read. Think of it as a multi-use giant With statement.
tnx alot for the info :) :)
I think I saw something before but I dont remember where I found it. There were a series of functions to like get the filename, format a file path and these kind of file related functions. Any idea where they are on the framework?
This is a much more straightforward (in my opinion) replacement for VB6's App.Path:
System.Windows.Forms.Application.StartupPath
You mean the functions in the System.IO.Path class? Try that.Quote:
Originally posted by MrPolite
tnx alot for the info :) :)
I think I saw something before but I dont remember where I found it. There were a series of functions to like get the filename, format a file path and these kind of file related functions. Any idea where they are on the framework?
Tygur, that's what I was looking for!
thanks :cool: