473,695 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Password protected html files

I need to create a simple asp.net application that use password protect some
html pages. The html page provider doesn't know asp.net. And the host doesn't
allow me to create user accounts.

What's the best way to store users/password except database tables? and to
store html files?
Jun 17 '06 #1
5 2798
I am not sure I understand your question completely. But if you are looking
to protect access to some HTML files in your website, you can use Forms
Authentication. Whenever the users try accessing the HTML files, if the
users are not authenticated, they will be redirected to a login page.

If you are looking at having some data in a HTML file and protecting that,
it is harder. You could take a look at the Dojo toolkit (dojotoolkit.or g)
which provides some strong encryption techniques using JavaScript. Any ideas?

--
blog: www.thinkingMS.com/pandurang
"nick" wrote:
I need to create a simple asp.net application that use password protect some
html pages. The html page provider doesn't know asp.net. And the host doesn't
allow me to create user accounts.

What's the best way to store users/password except database tables? and to
store html files?

Jun 17 '06 #2
I think I need to write a simple forms authentication app for a html page
designer. He will create html files, which are protected by forms
authentication. ...

For example, I create a form authentication app in securehtmls/. And the
html pages are dumped to the folder.
will it be redirected to login screen if an un-authenticated user try to
access the html files?

"Pandurang Nayak" wrote:
I am not sure I understand your question completely. But if you are looking
to protect access to some HTML files in your website, you can use Forms
Authentication. Whenever the users try accessing the HTML files, if the
users are not authenticated, they will be redirected to a login page.

If you are looking at having some data in a HTML file and protecting that,
it is harder. You could take a look at the Dojo toolkit (dojotoolkit.or g)
which provides some strong encryption techniques using JavaScript. Any ideas?

--
blog: www.thinkingMS.com/pandurang
"nick" wrote:
I need to create a simple asp.net application that use password protect some
html pages. The html page provider doesn't know asp.net. And the host doesn't
allow me to create user accounts.

What's the best way to store users/password except database tables? and to
store html files?

Jun 17 '06 #3

"nick" <ni**@discussio ns.microsoft.co m> wrote in message
news:2B******** *************** ***********@mic rosoft.com...
I think I need to write a simple forms authentication app for a html page
designer. He will create html files, which are protected by forms
authentication. ...

For example, I create a form authentication app in securehtmls/. And the
html pages are dumped to the folder.
will it be redirected to login screen if an un-authenticated user try to
access the html files?

"Pandurang Nayak" wrote:
I am not sure I understand your question completely. But if you are
looking
to protect access to some HTML files in your website, you can use Forms
Authentication. Whenever the users try accessing the HTML files, if the
users are not authenticated, they will be redirected to a login page.

If you are looking at having some data in a HTML file and protecting
that,
it is harder. You could take a look at the Dojo toolkit (dojotoolkit.or g)
which provides some strong encryption techniques using JavaScript. Any
ideas?

--
blog: www.thinkingMS.com/pandurang
"nick" wrote:
> I need to create a simple asp.net application that use password protect
> some
> html pages. The html page provider doesn't know asp.net. And the host
> doesn't
> allow me to create user accounts.
>
> What's the best way to store users/password except database tables? and
> to
> store html files?


I am not sure exactly what you are trying to do, but I think the html files
will still be served even with forms authentication unless they are in
special folders like App_Data etc (ver 2.0) or you go through some trouble
to have .net handle html files. If they are in special folders though, they
won't be served, they must be called from code. You could have a page with
an extension .aspx (which you put in a secure folder) and use something
like the following :

Sub Page_Load(sende r as object, e as eventargs)
DisplayHtmlFile ("Path to your secure file here")
End Sub
Sub DisplayHtmlFile (strFilePath as string)
dim reader as textreader = new streamreader(st rFilePath)
dim strText as string = reader.readtoen d
plc1.controls.c lear
plc1.controls.a dd(New literalcontrol( strtext))
reader.close()
End Sub

In .aspx file
<asp:placeholde r id=plc1 runat=server />
Jun 17 '06 #4
Mike,

I tried this recently. We had a bunch of images and HTML files to be
protected. I also thought (and remember seeing in earlier versions) such
static resources being served directly when the virtual folder has forms
authentication.

Recently, I tried this with ASP.NET 2.0 / IIS 6.0 and voila - the page
redirected to the login page set in forms authentication even when I accessed
static resources directly.

Nick, you can try this and see if it works for you. I made the settings in
web.config and had IIS 6.0 virtual directory setup as an IIS application.

Regards
Pandu

--
blog: www.thinkingMS.com/pandurang
"vMike" wrote:

"nick" <ni**@discussio ns.microsoft.co m> wrote in message
news:2B******** *************** ***********@mic rosoft.com...
I think I need to write a simple forms authentication app for a html page
designer. He will create html files, which are protected by forms
authentication. ...

For example, I create a form authentication app in securehtmls/. And the
html pages are dumped to the folder.
will it be redirected to login screen if an un-authenticated user try to
access the html files?

"Pandurang Nayak" wrote:
I am not sure I understand your question completely. But if you are
looking
to protect access to some HTML files in your website, you can use Forms
Authentication. Whenever the users try accessing the HTML files, if the
users are not authenticated, they will be redirected to a login page.

If you are looking at having some data in a HTML file and protecting
that,
it is harder. You could take a look at the Dojo toolkit (dojotoolkit.or g)
which provides some strong encryption techniques using JavaScript. Any
ideas?

--
blog: www.thinkingMS.com/pandurang
"nick" wrote:

> I need to create a simple asp.net application that use password protect
> some
> html pages. The html page provider doesn't know asp.net. And the host
> doesn't
> allow me to create user accounts.
>
> What's the best way to store users/password except database tables? and
> to
> store html files?


I am not sure exactly what you are trying to do, but I think the html files
will still be served even with forms authentication unless they are in
special folders like App_Data etc (ver 2.0) or you go through some trouble
to have .net handle html files. If they are in special folders though, they
won't be served, they must be called from code. You could have a page with
an extension .aspx (which you put in a secure folder) and use something
like the following :

Sub Page_Load(sende r as object, e as eventargs)
DisplayHtmlFile ("Path to your secure file here")
End Sub
Sub DisplayHtmlFile (strFilePath as string)
dim reader as textreader = new streamreader(st rFilePath)
dim strText as string = reader.readtoen d
plc1.controls.c lear
plc1.controls.a dd(New literalcontrol( strtext))
reader.close()
End Sub

In .aspx file
<asp:placeholde r id=plc1 runat=server />

Jun 18 '06 #5

"Pandurang Nayak" <pandurangATthi nkingmsDOT(nosp am)com> wrote in message
news:EE******** *************** ***********@mic rosoft.com...
Mike,

I tried this recently. We had a bunch of images and HTML files to be
protected. I also thought (and remember seeing in earlier versions) such
static resources being served directly when the virtual folder has forms
authentication.

Recently, I tried this with ASP.NET 2.0 / IIS 6.0 and voila - the page
redirected to the login page set in forms authentication even when I
accessed
static resources directly.

Nick, you can try this and see if it works for you. I made the settings in
web.config and had IIS 6.0 virtual directory setup as an IIS application.

Regards
Pandu

--
blog: www.thinkingMS.com/pandurang
"vMike" wrote:

"nick" <ni**@discussio ns.microsoft.co m> wrote in message
news:2B******** *************** ***********@mic rosoft.com...
>I think I need to write a simple forms authentication app for a html
>page
> designer. He will create html files, which are protected by forms
> authentication. ...
>
> For example, I create a form authentication app in securehtmls/. And
> the
> html pages are dumped to the folder.
> will it be redirected to login screen if an un-authenticated user try
> to
> access the html files?
>
> "Pandurang Nayak" wrote:
>

Mine servers up the pages without authentication. Your server must have been
configured to handle html through .net. Mine apparently isn't.

Mike
Jun 18 '06 #6

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

Similar topics

3
3414
by: Wm | last post by:
Something just occurred to me... <yeah, I know, it scared me too> I just password-protected a website by including a password authentication script in each page of a private section. The script checks the login against the mySQL database. This type of protection will only affect the .php pages, won't it? The images that are contained in the pages are not protected, as they would be if I had a .htaccess file on the parent directory..? This...
2
4753
by: Klaus Kragelund | last post by:
Hi I'm using DreamWeaver 2004 on a Win2k machine to create my homepage. After spending several hours of mingling with ASP I discover that my ISP doesn't support Access databases. So I turned to MySQL... However now I'm stuck. I created the files describes in this tutorial: http://www.gidforums.com/t-887.html But I know next to nothing about SQL. For example - where is the
3
17367
by: | last post by:
I am writing a small program that needs to be able to open Excel workbooks which are password protected. Does anyone know how to do this, without any interaction from the user? I am sure it is something simple that I am missing. Here is the relevant section of my code:
4
2759
by: connoisseur.infotech | last post by:
hello we are developing one tool where we need to open and make password protected zip files. we found some solutions but they don't support password protected things. does any one knows about this or any aproach for this.
4
2239
by: prophet | last post by:
so hopefully only one more question about this..... so I have a webpage using frames. I have a header and a column down the left, and the main body (all of which have different htmls but are brought together under index.html. From the header frame I have a list of different options which when clicked change the body of the page, leaving the header page the same. I have added a page which uses a 'gatekeeper' to loosely password protect...
3
2718
by: Noel S Pamfree | last post by:
Problem 1 ======= I need to create a page for a friend who operates a school website. She needs to set up a page so that only the Governors can access it. I thought I'd try to use JavaScript to prompt for a password. (I am only an amateur at writing JavaScript). It works fine in my tests when using Firefox but when I load the page in Internet Explorer it causes an error. (I am using the newest version 7 - the
2
2574
by: ManWithNoName | last post by:
Yay guys! I hope you all are having a warm fuzzy loveable day. The following questions are kind of related to this thread: Protect files (on web server) from web admin. If one has password protected zip file: 1) where would the content temporary be extracted to (probably the OS designated temp directory, right?)
7
10622
by: aagarwal8 | last post by:
Hi, I want to create a log file from my C# code. Currently I am encrypting the contents of this log file, but now the requirement is that no one should not be able to open this file from Windows Explorer. (Currently if we open the file using some editor, the encrypted contents are displayed) The file should only be read/modified from within the program.
0
2301
by: itshibu | last post by:
I tried to write a program that can open files from the server. But the shared folder in the Win2003 server is password protected. i tried the following code System.Diagnostics.Process.Start("net.exe", "use K: \\Server\URI\path\here /USER:username password" ) Dim p = New System.Diagnostics.Process p.Start("k:\" & Filename) System.Diagnostics.Process.Start("net.exe", "use /delete K:" ) And it is working fine. But for big files and...
0
8630
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
8568
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
8982
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 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...
1
8845
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
7660
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...
0
5839
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
4579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3003
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
2
2272
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.