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

Exception: System.IO.IOException: The process cannot access the

Hi All,

I have a situtation my application is running on windows 2003 server which is a domain and in web.config

<Identity impersonation=true username=ABC\XYZ password=******>

what i am doing in the code that i take folder path from user and retrive all file information from that folder and writing to a CSV file which i am creating

using StreamWriter.

Dim objSW As StreamWriter = New StreamWriter("MMLIVFILTRE_080721_165835.CSV")

Problem is when user enter path like : 'C:\Foldername' then it is working fine and writing all the files informatin in to the file which is created by streamwriter.

but when user enter path : '\\servername\c$\foldername' then is is giving me the below error

Exception: System.IO.IOException: The process cannot access the file 'D:\MMLIVFILTRE_080721_165835.CSV' because it is being used by another process.

'MMLIVFILTRE_080721_165835.CSV' in this file i am writing the information which is created by streamwiter.

can ypu tell me why this error is occuring. please tell me where i am doing wrong ?

Thanks

-nelly
Jul 22 '08 #1
2 2745
john20
37
Hi All

I want to access network resource file system which is on the windows 2003 server.

in the application i am giving the path like : \\servername\c$\Foldername\

and in the code this path i am giving to Directoryinfo

Dim objFilesPath As DirectoryInfo = New DirectoryInfo(\\servername\c$\Foldername\)

and impersonating the user in web.config file

<identity impersonate="true" userName="servername\ABC" password="xxxx" />

user ABC has full permission on the server.

what is happening directory info is not recognising the path.

but if i put the path like : c:\folder from the user machine then it is recognising the path.


why it is happening ? is this the permission issue??

where i am doing wrong ? can u please help.

Thanks in advance

-john
Jul 22 '08 #2
Plater
7,872 Expert 4TB
If you put the "\\servername\c$\Foldername\" into the Run dialog box from the start menu, does it work?

EDIT:
I don't know if you two are really the same person using different names or not, but it doesn't matter. You're asking almost identical questions so I'm merging the threads.
MODERATOR
Jul 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Chris Herring | last post by:
Hi there: Well, let me start off by saying that I am a Visual Studio drag and drop weenie, not a real programmer. So I tend to get confused when things do not look like the instructions said they...
1
by: Muscha | last post by:
Hello, Every now and then my application throw this exception: "Unable to read data from the transport connection" And when I break into the Visual Studio, the thread where it failed has...
6
by: Chad Crowder | last post by:
Getting the following error on my production server whether the file exists or not: "System.IO.IOException: Cannot create a file when that file already exists." Here's the code generating the...
2
by: André Nogueira | last post by:
Hi there! I am developing an Windows Explorer-like application that will tell you the size of any folder. But so far I have come across some problems. For instance, you may not have access to all...
2
by: sameer | last post by:
Hi, My very simple application VB.NET Visual Studio 2003 console application uses a log file to write some text to it. I am using StreamWriter object to create and open and then append text to...
6
by: Pieter | last post by:
Hi, For some procedures that throws exceptions, I would like to show different messages to the user depending on what type of exception he's getting. For instance this one: when the file is...
4
by: cnixuser | last post by:
Hello, I am posting reguarding some modifications I made to a text editor program that I wrote in my java class at my school today. The file I was modifying is a very simple java text editor with...
1
by: henrymania | last post by:
Am writing a code for database backup....by backupservlet is as given below i get the following exception
1
by: halimunan | last post by:
hi all, i`m doing an application to zip a file. this require system.io.file but i`m having problem as it cannot run because the error above.. do i need to close the File.xxx as the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.