473,725 Members | 2,075 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing a TEXT file


Is there a way using an Intranet ASP.NET web application to access a text file from a specified folder

The Logic

ReadTextFile.as p
FILE = "a_comma_delimi ted_text_file.t xt
PATH = "C:\folder\subf older\
Save it to SQL2000 databas
When someone in the organiztion connected to the network access this page
1) Is it possible for my ASPX page to read the FILE
2) Is there a permission that can be administered to make it work
3) Can ACCESS = PATH+FILE be a folder on every computer in my organization an accessible folder from my REadTextFile.as px

I'd appreciate your input


Yama Kamya
Sr. Micorsoft .NET Consultan

Nov 18 '05 #1
1 1490
Hi Yama,

It is possible for your ASP.NET page to access files both on the local
machine and over network shares. Using the System.IO namespace, you should
be able to do any file access/reading/writing operations necessary. (See
msdn for more information on these classes:
The only difficulty is specifying the correct privileges for your page.

To specify privileges for your page, you want to open up the IIS Manager
(this is usually under Administrative Tools).
Then you have two options:

1. You can define a new Application Pool that runs with some specific,
configured Identity that has security access to the file you want to read.
Then you set the Application Pool of the web application to this newly
configured pool. Make sure your in web.config you have <identity
impersonate="fa lse" />
2. You can disable anonymous access to your web application and required
Integrated Windows Authentication. Then in your web.config file, set
<identity impersonate="tr ue" /> and make sure the users calling your web
application have permissions to the file you want to access.

Mark Jen [MSFT]
Please reply in newsgroup.
This posting is provided "AS IS" with no warranties, and confers no rights.

"Yama" <an*******@disc ussions.microso ft.com> wrote in message
news:06******** *************** ***********@mic rosoft.com...

Is there a way using an Intranet ASP.NET web application to access a text file from a specified folder?
The Logic:

ReadTextFile.as px
FILE = "a_comma_delimi ted_text_file.t xt"
PATH = "C:\folder\subf older\"
Open for READONLY.
Save it to SQL2000 database
When someone in the organiztion connected to the network access this page:
1) Is it possible for my ASPX page to read the FILE?
2) Is there a permission that can be administered to make it work?
3) Can ACCESS = PATH+FILE be a folder on every computer in my organization an accessible folder from my REadTextFile.as px?
I'd appreciate your input.


Yama Kamyar
Sr. Micorsoft .NET Consultant

Nov 18 '05 #2

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

Similar topics

by: Lamberti Fabrizio | last post by:
Hi all, I've to access to a network file from an asp pages. I've red a lot of things on old posts and on Microsoft article but I can't still solve my problem. I've got two server inside the same NT domain, each one has its own web server. The web server is always IIS 5.0.
by: Chris Styles | last post by:
Dear All, I've been using some code to verify form data quite happily, but i've recently changed the way my form is structured, and I can't get it to work now. Originally : The form is called "form1", and I have selects called "PORTA", "PORTB" ... etc...
by: Kumar | last post by:
Hi Folks, I have a question regarding my windows c# application. This application just reads MS Excel file and puts the data in to sql server database. In that excel file ,it has one named cell as "OutputStampTime". I am facing problem while accessing this cell value. When I open excel, I can see the value as "6:49 AM" . But when I click on that cell in the formula bar I am seeing as 01/27/2005 06:49:47 AM.
by: Daniel Corbett | last post by:
I am trying to save a file dynamically created in a webpage. I get the following headers, but cannot figure out how to save the attachment. I am basically trying to replicate what internet explorer would do in this case. The headers I am getting are: Headers {Content-Disposition: attachment; filename="dynamic_file.mdb" Connection: close Cache-Control: private Content-Type: application/octet-stream
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if possible.. for example..i hav a menu in the parent form named "Administrator" whic has an item "mnuLogIn"..now when i click on login..another child form named "frmLogIn" is displayed..what i want to happen is this: when login form(frmLogIn) is...
by: samadams_2006 | last post by:
I'm having a problem in accessing a Microsoft Access Database in a VB.NET Web Application. It's so straight forward, I thought I'd walk you through all the details here: 1) I have a .NET Web Application called "Lesson18b" under "C:\Inetpub\wwwroot\Lesson18b". 2) I have one Web Form on this Lesson called "Form18b.aspx" 3) In this same Folder under Inetpub I have the Microsoft NorthWinds
by: Dana | last post by:
Hi All I have a menu control on my page, something like: <form action=Default.aspx runat="server"> <asp:Menu ID="Menu1" runat="server" BackColor="#F7F6F3" DynamicHorizontalOffset="2"> <Items> <asp:MenuItem Text="File" Value="File" Selectable="False"> <asp:MenuItem Text="Open" Value="Open"></asp:MenuItem>
by: Noy B | last post by:
Hi, I have developed a small application that is using a MSAccess DB. the problem is that it was developed on a machine where the application and the DB are both located. now it needs to be change that the application will be able to run on any other machine (using \\ syntax on the run command- not a problem) using the DB located on a static-different machine. for this purpose I need to create a Remote Connection from my
by: JT | last post by:
Hi, I've realized that my good fortune of not having my computer go into standby mode was the result of my application accessing a file on a shared network drive. Not going into standby is a very good thing for my application, but I don't want users to be required to share a drive and file just to accomplish this. I've read in old posts in various places stating that by importing kernel32.dll I could access a function called
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList steps successfully with the following code... Control myContainer = (Control)Wizard1.FindControl("SideBarContainer"); DataList mySideBarList = (DataList)myContainer.FindControl("SideBarList");
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.