473,785 Members | 2,714 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing a TEXT file

Hi

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\
ACCESS = PATH+FIL
Open for READONLY
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

Sincerely

Yama Kamya
Sr. Micorsoft .NET Consultan

Nov 18 '05 #1
1 1493
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:
http://msdn.microsoft.com/library/de...asp?frame=true)
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.

HTH,
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...
Hi,

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\"
ACCESS = PATH+FILE
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.

Sincerely,

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

23
2909
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.
6
2746
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...
2
30578
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.
5
3068
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
4
3640
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...
5
2266
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
0
1160
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>
4
4224
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
6
2272
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
8
10841
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");
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8971
agi2029
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...
1
7496
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 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...
0
6737
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();...
0
5380
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...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.