473,805 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question: Write file to "Secured" dir in website

I want to write a file to the "secured" dir that is on my website. The full
path is: C:\inetpub\wwwr oot\MyWebSite\S ecured

I tried this, but it didn't work:
Dim strFileName As String = "Secured\MyFile .txt"
Dim sw As New StreamWriter(st rFileName)
sw.WriteLine("T esting 1-2-3")
sw.Close()
Response.Redire ct(strFileName)

It gives me a System.IO.Direc toryNotFoundExc eption.

Any ideas how I can reference this correctly?

Thanks!
Nov 17 '05 #1
2 1137
"Secured\MyFile .txt" doenst look like valid path to me

Dim strFileName As String = "C:\inetpub\www root\MyWebSite\ Secured\MyFile. txt"

or

Dim strFileName As String = Server.Mappath( "") & "\Secured\MyFil e.txt"

would work

Mike
"VB Programmer" <gr*********@ go-intech.com> wrote in message news:<uU******* *******@TK2MSFT NGP10.phx.gbl>. ..
I want to write a file to the "secured" dir that is on my website. The full
path is: C:\inetpub\wwwr oot\MyWebSite\S ecured

I tried this, but it didn't work:
Dim strFileName As String = "Secured\MyFile .txt"
Dim sw As New StreamWriter(st rFileName)
sw.WriteLine("T esting 1-2-3")
sw.Close()
Response.Redire ct(strFileName)

It gives me a System.IO.Direc toryNotFoundExc eption.

Any ideas how I can reference this correctly?

Thanks!

Nov 17 '05 #2
"Secured\MyFile .txt" doenst look like valid path to me

Dim strFileName As String = "C:\inetpub\www root\MyWebSite\ Secured\MyFile. txt"

or

Dim strFileName As String = Server.Mappath( "") & "\Secured\MyFil e.txt"

would work

Mike
"VB Programmer" <gr*********@ go-intech.com> wrote in message news:<uU******* *******@TK2MSFT NGP10.phx.gbl>. ..
I want to write a file to the "secured" dir that is on my website. The full
path is: C:\inetpub\wwwr oot\MyWebSite\S ecured

I tried this, but it didn't work:
Dim strFileName As String = "Secured\MyFile .txt"
Dim sw As New StreamWriter(st rFileName)
sw.WriteLine("T esting 1-2-3")
sw.Close()
Response.Redire ct(strFileName)

It gives me a System.IO.Direc toryNotFoundExc eption.

Any ideas how I can reference this correctly?

Thanks!

Nov 17 '05 #3

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

Similar topics

0
2279
by: Brant | last post by:
Hi, I was curious to know how to properly use the HttpsURLConnection API to make a connection into a secure (SSL) web site and be able to pass in post variables to log-in to my account. Also, is it possible that once after making the logged-in connection to do another post-action to a form on a page that is in a username/password secured website? For example, I want to make a URL connection to a page by logging-in, and then using that...
0
11570
by: Antwerp | last post by:
Hi, I'm trying to create a perl script that will log into a website (the login form uses POST), navigate to several pages, and append the (html) content parsed from those pages to a seperate log file. I'm not very familiar with this aspect of perl, and have been having some trouble in the POSTing of the form data, while using cookies to log in. Visting the site automatically redirects you to a login page. Once you fill out the login...
2
3348
by: Amit D.Shinde | last post by:
Hello Experts.. I need some help regarding cookies and session objects and also global.asa file I am creating one cookie when a user logs in on my website. The cookie stores the login name of the user. I want that cookie should get deleted when user closes the browser without signing out. I think it is done in global.asa file . But i don;t know how to do it?
2
1315
by: Joe | last post by:
Hi, We want to build a couple of secured pages which will be viewable only to those who have an account. One way of implementing the security is using session cookies (temporary cookies). When a user logs in a session cookie is created. When the browser window is closed the session cookie disappears. This way when the browser is closed the session is over. So that even if one tries to copy and past the URL of a secured page, they...
2
5363
by: Murphy | last post by:
Our website contains subdirectories for each subsidiary company, each company has it's own look and feel to the pages in their subdirectory although they are all part of the main website. The code below in the Web.Config file defines the authentication as forms and the aspx file required for login if the user is unauthenticated... this works well for the root level company web pages however when a user viewing the website of SubCompanyA...
1
3266
by: IkBenHet | last post by:
Hello, Currently I am using a large input form on a website that is based on ASP and JavaScript. Depending on the values that are filled in by the user the forms does a refresh and makes other input fields available to fill in. I use the JavaScript OnChange function (=clientside) that creates a querystring and does a refresh of the page. It works fine.
2
1183
by: roy anderson | last post by:
Hey all, I'm not new to web development, but totally clueless regarding web security/logins and such. I have a website which requires users to login, checks their info against a SQL Server backend, then saves their login as a session variable. As they browse through the various pages of the site, each page checks to see if the Session variable exists/is not null, etc. If the check fails, the page redirects them to the login form. ...
5
1293
by: Spook | last post by:
Hi. I have created a secured database which lots of my colleagues use. However when I want to make changes I can't because invariably there is somebody using it. Is there a way of either kicking everybody out or finding out who is using it, so I can go and beat them up so they get out. cheers
9
3475
by: ewolfman | last post by:
Hi, I need to provide the user with the option to click something, and what follows is: 1. Download a word document, without displaying winword. 2. Printing the document to the default printer (no print dialog should pop). 3. Close word. All of this must be completely "transparent" to the user, just like a
0
9718
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
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
10617
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...
1
10370
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,...
0
10109
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 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...
0
9186
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
7649
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
6876
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();...
3
3008
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.