473,387 Members | 1,582 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,387 software developers and data experts.

Web Service - Current directory?

How do I access a file in the current directory? If my web service runs
Directory.GetCurrentDirectory() I get c:\winnt\system32
Nov 21 '05 #1
4 6230
What do you mean by the current directory? If you mean the directory the web
application is in on the server then try using the MapPath method.

http://msdn.microsoft.com/library/de...ppathtopic.asp

--
Steve Willcock (MCSD for Microsoft.NET)
http://www.willcockconsulting.com/
"Ben Bloom" <vt***@yahoo.com> wrote in message
news:er*************@TK2MSFTNGP09.phx.gbl...
How do I access a file in the current directory? If my web service runs
Directory.GetCurrentDirectory() I get c:\winnt\system32

Nov 21 '05 #2
Steve Willcock wrote:
What do you mean by the current directory? If you mean the directory the web
application is in on the server then try using the MapPath method.

http://msdn.microsoft.com/library/de...ppathtopic.asp


Ah. I see my problem. I'm trying to call this from a class that gets
instantiated by my web service. Am I best off passing in the path as a
parameter to the constructor (or method that needs it)?

Thanks.
Nov 21 '05 #3
Yes, that's what I would do - it makes your component more generic anyway.

Steve

"Ben Bloom" <vt***@yahoo.com> wrote in message
news:eV**************@TK2MSFTNGP12.phx.gbl...
Steve Willcock wrote:
What do you mean by the current directory? If you mean the directory the web application is in on the server then try using the MapPath method.

http://msdn.microsoft.com/library/de...ppathtopic.asp


Ah. I see my problem. I'm trying to call this from a class that gets
instantiated by my web service. Am I best off passing in the path as a
parameter to the constructor (or method that needs it)?

Thanks.

Nov 21 '05 #4
True, true. Thanks.

Steve Willcock wrote:
Yes, that's what I would do - it makes your component more generic anyway.

Steve

"Ben Bloom" <vt***@yahoo.com> wrote in message
news:eV**************@TK2MSFTNGP12.phx.gbl...
Steve Willcock wrote:
What do you mean by the current directory? If you mean the directory the
web
application is in on the server then try using the MapPath method.


http://msdn.microsoft.com/library/de...ppathtopic.asp
Ah. I see my problem. I'm trying to call this from a class that gets
instantiated by my web service. Am I best off passing in the path as a
parameter to the constructor (or method that needs it)?

Thanks.


Nov 21 '05 #5

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

Similar topics

6
by: Laszlo Zsolt Nagy | last post by:
Sorry, I realized that the import zlib was not executed from my (working) service. So here is the question: why can't I use zlib from a win32 service? Is there any way to make it working? ...
1
by: Samuel R. Neff | last post by:
We're using a 3rd party C DLL in a project that we don't have source for. When we call the DLL from a console app everything works fine. However, when we call it from a Windows Service, the DLL...
4
by: Bruce | last post by:
I am developing an ASP.NET web service application. It works fine on my WinXP Prof development machine. But when I send it to a Windows Server 2003 system I get the following error (attached...
6
by: Bruce | last post by:
I am doing development work on an asp.net app and a web service on a Win XP Pro SP2 development workstation, using vs.net 2003. For reasons that I wont try to explain here, I recently moved the...
5
by: Stu Carter | last post by:
Hi, ENV: Windows 2003 Server SP1 (+all updates), VS 2003, .Net 1.1 SP1 We've got an ASP.Net web application using State Service. All is fine until we tried to use the app through a virtual...
2
by: TheBurgerMan | last post by:
Hi all. I am using W2K3, .NET2 on a machine running AD and Exchange. I started getting the message below last week. I googled the error and not much was returned, but I did find this;...
2
by: Soren S. Jorgensen | last post by:
Hi, How do I see, from within my main method, in what context my assembly, containing my service program, is executed ?? I want to be able to detect if the assembly is executed by the service...
13
by: dancer | last post by:
I have made a new post because when I try to respond to another, I get the error, "Article Rejected -- Ill-formed message id" This is in response to the advice of Juan Libre to install Net...
0
by: Alwin D | last post by:
Hello, How can I get the current directory of Web Service? Usually my Web services are under Inetpub directory. I would like to write trace file into that place. If I try to trace e.g....
2
by: Solomon_Man | last post by:
All, I have a Windows Service application that has database connectivity and needs the capability to let a user know that there has been a db failure. What is the proper way to notify a user that...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.