473,378 Members | 1,413 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

get current EXE file name?

stupid question:

RemotingConfiguration.Configure("MyProject.exe.con fig");

(where the actual EXE that's built is named "MyProject.exe", of course).

is there any way to do that without hard coding it?

I tried:

RemotingConfiguration.Configure(null);

but then it doesn't read the config file at all.

I'm hoping for something like:

RemotingConfiguration.Configure(GetProjectEXEName( ) + ".config");

Except I can't find anything in the docs to say how to do that. I'm sure
it's in there somewhere...

--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003 International
Conference on Intelligent User Interfaces]
Nov 15 '05 #1
3 6388
Check in the System.Reflection.Assembly namespace. There are some static (I
think) methods in there that allow you to obtain the name of the current
assembly and/or manifest etc. There should be at least one function that
does what you need.

"Reginald Blue" <Re***********@hotmail.com> wrote in message
news:ez*************@TK2MSFTNGP11.phx.gbl...
stupid question:

RemotingConfiguration.Configure("MyProject.exe.con fig");

(where the actual EXE that's built is named "MyProject.exe", of course).

is there any way to do that without hard coding it?

I tried:

RemotingConfiguration.Configure(null);

but then it doesn't read the config file at all.

I'm hoping for something like:

RemotingConfiguration.Configure(GetProjectEXEName( ) + ".config");

Except I can't find anything in the docs to say how to do that. I'm sure
it's in there somewhere...

--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003 International
Conference on Intelligent User Interfaces]

Nov 15 '05 #2

AppDomain .CurrentDomain .FriendlyName

will give you the application name

however, to read the configuration file use

ConfigurationSettings .AppSettings

- Sarosh
-----Original Message-----
stupid question:

RemotingConfiguration.Configure("MyProject.exe.co nfig");

(where the actual EXE that's built is named "MyProject.exe", of course).
is there any way to do that without hard coding it?

I tried:

RemotingConfiguration.Configure(null);

but then it doesn't read the config file at all.

I'm hoping for something like:

RemotingConfiguration.Configure(GetProjectEXEName () + ".config");
Except I can't find anything in the docs to say how to do that. I'm sureit's in there somewhere...

--
Reginald Blue
"I have always wished that my computer would be as easy to use as mytelephone. My wish has come true. I no longer know how to use mytelephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003 InternationalConference on Intelligent User Interfaces]
.

Nov 15 '05 #3
rs*****@hotmail.com wrote:
AppDomain .CurrentDomain .FriendlyName

will give you the application name
Yes, that's what I wanted.
however, to read the configuration file use

ConfigurationSettings .AppSettings


Unfortunately, that doesn't give me anything useful for the remoting
configuration. RemotingConfiguration.Configure only expects a file name.
Why it doesn't work like ConfigurationSettings is beyond me.
-----Original Message-----
stupid question:

RemotingConfiguration.Configure("MyProject.exe.con fig");

(where the actual EXE that's built is

named "MyProject.exe", of course).

is there any way to do that without hard coding it?

I tried:

RemotingConfiguration.Configure(null);

but then it doesn't read the config file at all.

I'm hoping for something like:

RemotingConfiguration.Configure(GetProjectEXEName( )

+ ".config");

Except I can't find anything in the docs to say how to do that. I'm
sure it's in there somewhere...


--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces]
Nov 15 '05 #4

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

Similar topics

6
by: vishal | last post by:
hi how can i get the file name from which the current executing file is called. i m making a scrript which will be called from many other scripts. this script performs some calculation and then...
3
by: JT | last post by:
is there a command in asp to get the name of the current page? furthermore, is there a way to retrieve the name of the current page within an 'included' file (not the name of the included page,...
1
by: Andy Wells | last post by:
I'm using VB.NET and I have an application that binds a schema to the main form's controls, and the user has the ability to load an XML file through the schema and into the bound form. My...
11
by: Ken Varn | last post by:
I want to be able to determine my current line, file, and function in my C# application. I know that C++ has the __LINE__, __FUNCTION__, and __FILE___ macros for getting this, but I cannot find a...
3
by: Rico | last post by:
Hello, I have a generic process that logs errors from different sources. When I call this code, I'd like to also submit the name of the function or sub that is raising the error without having...
7
by: Dave | last post by:
Hi, i need to get the name of the current aspx file in code-behind. Assume the current aspx file is "myfile.aspx", i want to put value "myfile" into a variable in code-behind. Is that possible?...
1
by: thokala | last post by:
Hi Everyone, I have XML file. It have some date to display the Graph. In that file i need to provide the date value. I would like to give the current date instead of hard coded date. I tried...
8
by: =?Utf-8?B?R2VvcmdlQXRraW5z?= | last post by:
Greetings! I wrote a small Exe that simply runs Shell to load PowerPoint and launch a particular file, depending on the day of the week. However, it was set up for office 2003 (I naively hardcoded...
2
by: blisspikle | last post by:
Is there any way to use the "imports" keyword for your current solution to use code (classes) that were used in a different solution in a different directory without compiling them to a dll? I...
1
vikas251074
by: vikas251074 | last post by:
Hello sir, I am facing some problem for which I am trying hard to solve it. But in vain. This programe is for View/Deletion. When I run program for first time, I select vlan from list and press...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.