473,403 Members | 2,183 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,403 software developers and data experts.

FileNotFoundException

Hi all,
I have a problem with my asp.net application.
I can't read a file that is on another server (10.1.8.15), while my
application in on 10.1.8.14.
In that file I have a shared folder, within the file "txt".
I've used the following code:

bool present;
FileInfo f1 = new FileInfo(@"\\10.1.8.15\CDG\CDG_CD.txt");
if (f1.Exists)
{ present = true; }
else
{lblError.Text += ". Missing file " + f1.ToString();}

but always says me that the file does not exist
(FileNotFoundExcpetion).
If I run the command \\10.1.8.15\CDG\CDG_CD.txt from Start - Run, I can
see the file.
What's the problem?

Thanks a lot.

Luigi

Sep 20 '06 #1
1 1224
by default the asp.net account does not have network access. change the
account to a domin account. if you ar on 2003 set the app pool identity to a
domain account with access to the share.

-- bruce (sqlwork.com)

"Luigi" <ci****@inwind.itwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi all,
I have a problem with my asp.net application.
I can't read a file that is on another server (10.1.8.15), while my
application in on 10.1.8.14.
In that file I have a shared folder, within the file "txt".
I've used the following code:

bool present;
FileInfo f1 = new FileInfo(@"\\10.1.8.15\CDG\CDG_CD.txt");
if (f1.Exists)
{ present = true; }
else
{lblError.Text += ". Missing file " + f1.ToString();}

but always says me that the file does not exist
(FileNotFoundExcpetion).
If I run the command \\10.1.8.15\CDG\CDG_CD.txt from Start - Run, I can
see the file.
What's the problem?

Thanks a lot.

Luigi

Sep 20 '06 #2

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

Similar topics

1
by: ulf | last post by:
Hello, After I got a FileNotFoundException in my real life CSharp code, I nailed it down to the following line: System.EnterpriseServices.ResourcePool rp = new...
2
by: Michael Sanford | last post by:
I'm getting a Sysmte.IO.FileNotFoundException when executing the code below. It is straight from the example. This works on one machine, but not the other. Other benign calls invoke the same...
0
by: Daylor | last post by:
any suggestions, why FileNotFoundException is throw , when im try to send object from appdomain to other ? (the object inherits MarshalByRefObject) i dont have a clue what the VS.2003 want...
3
by: Nick | last post by:
Hello, Let me explain my situation. There is an application in C++ (that I didn't write) that needs to call a C# DLL. One option, I believe, would be to compile the app with the clr switch....
5
by: MattC | last post by:
Hi, I am getting the following error: System.IO.FileNotFoundException: C:\Dreamtxt\WebSites\mysite\www\feedback.aspx at System.Web.UI.TemplateParser.GetParserCacheItem() at...
3
by: James | last post by:
Hi guys Do you ever get the exception in Managed C++? How can I know which file or dll is missed?
5
by: SGRing | last post by:
I have a c# application that I'm migrating from 2003 to 2005, and I moved it to another machine. It built ok. But, when trying to run I get System.IO.FileNotFoundException was unhandled...
0
by: Peter Vestergaard | last post by:
Hi, I am running VS .Net 2005. I have an application in which one of the classes are having a member that is an instance of a class defined in a managed C++ dll. As soon as I try to create an...
2
by: jjlagtap | last post by:
Hey everyone When I try to open a file i get the Exception listed below. The weird thing is it works when I run the web app locally and when i use a remote server and open a file on my computer....
2
by: bbindae | last post by:
I am trying to check whether XmlTextReader reads the xml file successfully or not. MSDN says that XmlTextReader raise the FileNotFoundException when it cannot find the file to read. Here is...
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...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.