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

I'm tired to write MapPath("") for every System.IO operation...

Hi!
I'm new in aspnet, and i'm already tired to write MapPath("") for every
System.IO operation, where (in config maybe) i can set once, that cwd =
server root path, not winnt\system32\?

I mean f.e. this:
File.OpenRead ("logo.gif") <- this file is in application server root
directory i.e. c:\inetpub\wwwroot\aspnetproject\logo.gif

Thanks a lot!
--
Ivan Burganovsky
From PHP to AST.net
Dec 15 '05 #1
1 1624
Perhaps call it once, store in Session and fetch from there for subsequent
requests?

"Burganovsky" <ne*****@inbox.ru> wrote in message
news:MP***********************@news.wplus.net...
Hi!
I'm new in aspnet, and i'm already tired to write MapPath("") for every
System.IO operation, where (in config maybe) i can set once, that cwd =
server root path, not winnt\system32\?

I mean f.e. this:
File.OpenRead ("logo.gif") <- this file is in application server root
directory i.e. c:\inetpub\wwwroot\aspnetproject\logo.gif

Thanks a lot!
--
Ivan Burganovsky
From PHP to AST.net
Dec 16 '05 #2

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

Similar topics

3
by: Mikkky | last post by:
The sample code below returns and error " The type or namspace name 'Server' could not be found". Please help. using System;using System.IO; using System.Xml;using System.Diagnostics; using...
4
by: ramonred | last post by:
txtUpload1.PostedFile.SaveAs(Server.MapPath("~") + "\\" + file1.Name); this code loads the file in the root directory of my application, by using the tilde. How do I accomplish getting the file...
1
by: Jim Heavey | last post by:
Hello, I am trying out how to programatically figure out where my datafile is. I thought I could use Server.MapPath to provide me the name of where my webpage is located, as I have used that in...
2
by: Tee | last post by:
Hi, I am currently using Server.MapPath in my aspx files, but because of I am using it more than once, I would like to move these code away from aspx and make it as a public function inside...
10
by: Kenneth P | last post by:
Hi all, I have an Access database and try to create a connection to it using the Server.MapPath method. I have the app lib in c:\inetprub\wwwroot\apps\myApp and the database in...
4
by: bennett | last post by:
How can I do a loop from 1 to 5, where on line 1 I print 1 space followed by a button, on line 2 I print 2 spaces followed by a button, on line 3 I print 3 spaces followed by a button, etc.? I...
1
by: Steven Prasil | last post by:
When I run/debug a program with Console.out.write statements inside and the program execution reaches this statement then a new console/command prompt window (this with black background) is opened...
1
by: Curious | last post by:
I want to write to an output file, "C:\\temp\\debug.txt": If the file exists, append the new content to the end of the file (instead of overwriting the current content). If the file doesn't exist,...
7
by: duli | last post by:
Hi: I would like recommendations for books (in any language, not necessarily C++, C, python) which have walkthroughs for developing a big software project ? So starting from inception, problem...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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
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: 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
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.