473,803 Members | 3,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dumb question - How can I get the app.path from .NET?

what's the equivalent syntax for app.path in VB.NET?
Thanks
Bill
Nov 20 '05
14 1394
Cor
Hi Herfried,

Why not this one that Bill did give in this thread?

appPath = System.Windows. Forms.Applicati on.StartupPath

Cor

Private Function ApplicationPath () As String
Return _
Path.GetDirecto ryName([Assembly].GetExecutingAs sembly().Locati on)
End Function

Nov 20 '05 #11
* "Cor" <no*@non.com> scripsit:
Why not this one that Bill did give in this thread?

appPath = System.Windows. Forms.Applicati on.StartupPath


We previously had a discussion in this group (I remember that Tom Spink
took part in this discussion). Somebody told us that this method may
return a wrong path on some Windows versions if the app is started by a
shortcut.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #12
Cor
Herfried,

Thanks you for the explanation, maybe it is good to tell that next time in
your message.

(Not as a very bad bug please :-))))

Cor
Why not this one that Bill did give in this thread?

appPath = System.Windows. Forms.Applicati on.StartupPath


We previously had a discussion in this group (I remember that Tom Spink
took part in this discussion). Somebody told us that this method may
return a wrong path on some Windows versions if the app is started by a
shortcut.

Nov 20 '05 #13
* "Cor" <no*@non.com> scripsit:
Thanks you for the explanation, maybe it is good to tell that next time in
your message.

(Not as a very bad bug please :-))))


I am not even sure if this really occurs on some systems.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #14
CMG;
Can you help me further by telling me where "NP" came from? :-)
As a matter of fact, I'm looking for some help in .NET for my upcoming
projects. Do you want to lend me a hand?
Thanks
Bill aka "NP" :-)

"CMG" <vb****@divx-warez.nl> wrote in message
news:03******** *************** *****@phx.gbl.. .
NP, i was glad there are some questions that new ppl like
me can awnser :)
-----Original Message-----
Perfect!
Thanks Mr. B, CMG, and Rob for your quick response!
Bill

"Mr. B" <Us**@NoWhere.c om> wrote in message
news:kg******* *************** **********@4ax. com...
With Deft Fingers, "Bill Nguyen" <bi************ *****@jaco.com> wrote:
>what's the equivalent syntax for app.path in VB.NET?

Dim appPath As String ' Application Start Path
appPath = System.Windows. Forms.Applicati on.StartupPath
And I think you need:

Imports System.IO
Regards,

Bruce

.

Nov 20 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
2518
by: squash | last post by:
a dumb question i had on my mind: Say you have a dynamically created web page . Isn't it more secure to write it in php since a visitor will not be able to tell it is dynamically created? But if you write it in perl, you have to put it in your cgi-bin which automatically means it's a dynamically generated page? security by obscurity . Is this true or hardly means anything? thx!
15
2689
by: Good Man | last post by:
Hey there I have a dumb question.... Let's say i have a database full of 4000 people.... I select everything from the database by: $result = mysql_query("SELECT * FROM People");
2
1924
by: Tim | last post by:
Maybe I've been working too long, but has anyon had their python interpreter stop taking commands. The IDLE version works fine, but under Windoze: 1) execute "python" in teh command shell 2) ...interpreter comes up fine 3) type in anything and you get "SyntaxError: invalid syntax" Literally, you could type in "import sys" or anything common and you get the
4
1420
by: Aubrey Hutchison | last post by:
I have exhausted places to look for where "PYTHONPATH" is located.. In windows (using the DOS command) no such thing exist but path does. I find no file with that name. I have yet to find a config file that I would think might work as PYTHONPATH. What am I missing? Thanks
4
3442
by: Python Dunce | last post by:
I've run into an issue with glob and matching filenames with brackets '' in them. The problem comes when I'm using part of such a filename as the path I'm passing to glob. Here's a trimmed down dumb example. Let's say I have a directory with the following files in it. foo.par2 foo.vol0+1.par2 foo.vol1+1.par2 zzz .par2 zzz .vol0+1.par2
8
1612
by: Fred Hebert | last post by:
I have a function that requires a LPCTSTR parameter. I have the value I want to pass to it in a TextBox->Text field. Is there any way to do it in a single assignment. e.g. DWORD Xyz::TheFunc(LPCTSTR lpVal) .... TheFunc(Junk->Text->Something());
2
2228
by: Bill Nguyen | last post by:
I would like to add a new VB.NET project using the same folder being used by another project so that I can share several forms already creaded by the other project. However, .NET created a new folder using whatever project name I supplied. Is there a work around for this? Thanks Bill
16
1653
by: CMM | last post by:
Is it me or has anyone noticed that F1 is really dumb in VS2005. Since VB3 I have been able to click F1 on an ambiguous method in code and the IDE automatically determines the type based on the code itself and shows the right help topic. This even worked more or less in VS2003. But in VS2005, if I highlight the "Host" method below and hit F1 I get a help topic on the "UriBuilder.Host" property. Huh????? That's dumb. Dim o as New...
3
1165
by: Nonee | last post by:
Ok ok... I have been staring at this for a generation or so now and it is not working. And it is something really simple too. I have a listbox of mp3s (flbMp3s). I have a textbox (txtSearch). I have the directory of the mp3s (System.IO.Directory.GetFiles). I want to search the directory from the text in the textbox, adding to the listbox if there is a match. I have tried file.IndexOf(txtSearch.Text), file.Contains(txtSearch.Text),...
0
10550
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5501
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5633
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2972
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.