473,320 Members | 1,853 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.

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 2778
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.org)
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.org)
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**@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.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.org)
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(sender 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(strFilePath)
dim strText as string = reader.readtoend
plc1.controls.clear
plc1.controls.add(New literalcontrol(strtext))
reader.close()
End Sub

In .aspx file
<asp:placeholder 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**@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.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.org)
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(sender 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(strFilePath)
dim strText as string = reader.readtoend
plc1.controls.clear
plc1.controls.add(New literalcontrol(strtext))
reader.close()
End Sub

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

Jun 18 '06 #5

"Pandurang Nayak" <pandurangATthinkingmsDOT(nospam)com> wrote in message
news:EE**********************************@microsof t.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**@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.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
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...
2
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...
3
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...
4
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...
4
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...
3
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...
2
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...
7
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...
0
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 ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.