Paladine commented: Sweet code to note! +36
SO you can boot of the 98 disk, but not the xp disk?
Hmm, I've had this problem before. The only thing is... I solved it by booting off the winxp then doing a repair, typing:
chkdsk /r
(I think)
Let me sleep on it... I'll get back to you asap.
p.s. try using other bootable cds such as norton av 2003 to see if it is your win xp cd or otherwise.
I will try and help you further with this, but I offer no guarantees.
Thankyou very much, your help will not go unrewarded.
Yeah lately I've been pretty flat out with the job, this week especially. It's only a short week here in Australia, we had Monday off, and we have to go down to some awards thing in a town about 4hours away from here on Friday and I have to deploy my asp .net application so employees can update the vacancies page of our website instead of me doing manual data entry :P. Then on top of that I have to train all receptionists across the branches over the phone to use it. THEN on top of that, I have to create a powerpoint presentation for this awards thingy coming up. THEN on top of that, I am working on my personal website every spare moment I get. On top of that I am stressing out about some computer parts I've ordered from Brisbane that I ordered AGES ago and they still aren't in stock :(. You can imagine how stressed I am, I am fresh out of year 12, the only thing I had to worry about during school was missing the bus. Now it's bloody everything, phone bill, electricity bill etc etc. But everyone else has made it so I'm not going to let anything phase me :D I'm just staying happy. It's hard to be angry or upset having friends such as mine. Anyways that was one HUGE rant.
This article will inform you more about forms Authentication using ASP .NET and Visual Basic .net (VB .NET). Before I continue I must stress that the web.config is xml and must be used with extreme sensitivity in mind. All tags must be closed etc. or else you will end up with endless problems trying to figure out what you've done wrong. I should also stress that no code should be copied from this article as invisible characters such as spaces may be carried with it and your code wont work. The best thing to do is just to type it from scratch.
When using forms Authentication you must first declare it in the web.config. If you are using vb .net as your language then the web.config will allready have been auto-generated for you. The default is:
<authentication mode="Windows" />
Authentication modes that can be used are: "Windows", "Passport" and of course "Forms". Since this post is about Forms authentication we will be using "Forms" and perhaps I will go more indepth about the others in a later post. Now that we have chosen forms authentication, we have to remove the '/' at the end as this is closing the tag and we have yet to enter more information in so we do this:
<authentication mode="Forms">
More to go here
</authentication>
The Forms authentication has the following properties:
Name: The name of the HTTP cookie where authentication information is stored
loginUrl: The name says it all :) what …
have you tried actually storing it in a session?
Session("ws") = ws.authenticateuser
Sorry, I'm not sure if I'm going to be very helpful with this one :S
p.s. this should be posted in the asp .net forum :)
lol soz for not replying. Yeah I'm kinda in a band at the moment.... kinda... and the guitar is a fully sic black Ibanez rg170, I love it man. I'm written a few riffs and songs, most are depressing since I used to be all morbid and stuff but yeah, things have gotten alot better since then, I just haven't written any songs because I'm waaaay to busy lately :).
For some reason, when I am in the password text box, when I press enter, it simply clears both fields. Doesn't validate, doesn't login, just clears the fields. What is going on here?
Codebehind:
PrivateSub cmdLogin_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogin.ServerClick
If FormsAuthentication.Authenticate(txtUser.Text, txtPass.Text) Then
FormsAuthentication.RedirectFromLoginPage(txtUser.Text, chkPersist.Checked)
Else
lblStatus.Text = "Not Authenticated"
IfCInt(ViewState("Tries")) > 1 Then
Response.Redirect("Denied.aspx")
Else
' Otherwise, increment number of tries.
ViewState("Tries") = CInt(ViewState("Tries")) + 1
EndIf
EndIf
EndSub
And the aspx page is attached. Please help.
Slade
<%@ Register TagPrefix="uc1" TagName="Header" Src="Header.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="FacLogin.aspx.vb" Inherits="sladesfaculty.FacLogin"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>FacLogin</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK href="FacStyles.css" type="text/css" rel="stylesheet">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td width="100%"><uc1:header id="Header1" runat="server"></uc1:header></td>
</tr>
<tr>
<td vAlign="middle" align="center" width="100%" height="100%">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td colSpan="3"><asp:label id="lblStatus" runat="server" ForeColor="Red" Font-Size="X-Small"></asp:label></td>
</tr>
<tr>
<td vAlign="top" rowSpan="3"><IMG src="Images/Login/lgnlt.gif"></td>
<td vAlign="top" bgColor="#999999"><IMG src="Images/Login/lgntop.gif"></td>
<td vAlign="top" rowSpan="3"><IMG src="Images/Login/lgnrt.gif"></td>
<tr>
<td height="126">
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" bgColor="#999999" border="0">
<tr>
<td><asp:label id="lblUser" runat="server" ForeColor="Black" Font-Size="X-Small" BackColor="Transparent">Username:</asp:label></td>
<td align="right"><asp:textbox id="txtUser" runat="server" MaxLength="20" Font-Size="X-Small" BorderStyle="Inset"></asp:textbox></td>
</tr>
<tr>
<td colSpan="2"><asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" ErrorMessage="*Username Required" ControlToValidate="txtUser"
Font-Size="X-Small"></asp:requiredfieldvalidator></td>
</tr>
<tr>
<td><asp:label id="lblPass" runat="server" ForeColor="Black" Font-Size="X-Small" BackColor="Transparent">Password:</asp:label></td>
<td align="right"><asp:textbox id="txtPass" runat="server" TextMode="Password" MaxLength="20" Font-Size="X-Small"
BorderStyle="Inset"></asp:textbox></td>
</tr>
<tr>
<td colSpan="2"><asp:requiredfieldvalidator id="RequiredFieldValidator2" runat="server" ErrorMessage="*Password Required" ControlToValidate="txtPass"
Font-Size="X-Small"></asp:requiredfieldvalidator></td>
</tr>
<tr>
<td colSpan="2"><asp:checkbox id="chkPersist" runat="server" Text="Remember Me?" ForeColor="Black" Font-Size="X-Small"
BackColor="Transparent"></asp:checkbox></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" background="Images/Login/lgnbtm.gif" height="43"><input type="submit" value="Login" id="cmdLogin" runat="server"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<asp:Label id="lblCopy" runat="server" Font-Size="X-Small"> SladesFaculty 2004</asp:Label></td>
</tr>
</table>
</form>
</body>
</HTML>
I need to create a date updated field for ms sql 2000. The current trigger I have only works for the insertion of data and it is "(getdate())" is there one that I can use for insertion and update of fields?
Ta,
Slade
I just researched a little. It's not possible :).
Is there any possible way to remove a query string without redirecting to another page? You see, my problem is I am using panels, when the create new button is clicked, it gives the querystring of "?JobID=New" now when I click on another button (which simply hides the current panel and makes another visible), the query string is still there. I have tried Request.QueryString.Remove and Request.QueryString.Clear but it says it is read only, is there any possible way to remove it?
Visual Studio .NET was developed by microsoft, so the learning curve for the GUI is easy if you have used other microsoft programs before. Also, I have been learning asp .net, vb .net and c# .net for the past 4-5 months and I must say that I allready have a reasonable knowledge of each language. The only language I have programmed in before these was vb6 and a little c/c++ so, I haven't had much experience. The learning is quick and fun. What languages are you using at the moment? Some good books are:
SAMS teach yourself vb .net in 24 days
SAMS teach yourself asp .net in 24 days
I have both books (I think it's 24 days lol, I forget) but yeah. Basically I read a little of those as well as do some research on the web. It seems hard starting off but it doesn't take long for you to get used to it.
Hope I helped,
Slade
I'm not sure if it's fixable at all.
cookie -> kickarsesig!
haha, I payed around 1600 AU for my setup, probably about 2000 now.
inside a compactor
lol yep, and I do it when people are around too. I usually rip out my guitar for my fav songs and try to learn them.
I have been working with this code for a while now... after a few builds there is an error. What actually happens is in the aspx code, the "runat = server" disappears. This is more than likely because it isn't included in the <forms>tag</forms>
Anyways, just a little bit of extra info.
Slade
haha good reminder :)
I have an alternative to this, will show you once I do it :P
Thanks heaps Paladine, you shed some light on a few things.
Fiero ->Mozilla
Well firefox 0.8 is my fav... haven't had troubles with it. I would try netscape if I were you, they use some mozilla source code but you should give it a go and see what happens. Opera is very bad, I highly dislike it. Otherwise it's IE for you buddy!
Suddenly, Incissor died.
(look it's become 3 word sentences!)
chiquita -> Liero
lol well I copied and pasted it from vs .net, but I've done it before using this rich text editor :D
OK I would still like to get the windows encryption working (above) but I have finished a web application one for now:
Imports System.Web.Security
PrivateSub btnProcess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProcess.Click
Dim encpass AsString = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text, "sha1")
lblResult.Text = encpass.ToString()
EndSub
I can't understand why my code wont work. Check it out.
Imports SHA1_Encryption
Imports System.Security.Cryptography
PublicClass Form1
Inherits System.Windows.Forms.Form
(Windows for designer generated code)
PublicFunction ComputeHashValue(ByVal data() AsByte) AsByte()
Dim hashAlg As SHA1 = SHA1.Create()
Dim hashvalue() AsByte = hashAlg.ComputeHash(data)
Return hashvalue
EndFunction
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim test AsByte()
test = ComputeHashValue(Encoding.ASCII.Text(TextBox1.Text))
EndSub
EndClass
The encoding part wont work and when I hover over it it says. "Name 'Encoding' is not declared." any ideas? Maybe I'm missing a library reference?
Yeah man, maybe that's it, I dunno, but I really really like the whole yelling/screaming thing, it does relieve a bit of stress I guess. I still have no idea of my fav. heavy metal song, it is leaning more toward a7x again, I guess it just changes with what I currently listen to *shrug*.
Ok, here I have my hit counter as a text file.
PrivateSub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
IfNot Page.IsPostBack Then
Dim nCount As Int32 = 108
nCount = GetCounterValue()
lblTest.Text = nCount.ToString()
EndIf
EndSub
PrivateFunction GetCounterValue() As Int32
Dim ctrFile As StreamReader
Dim ctrFileW As FileStream
Dim sw As StreamWriter
Dim strPath AsString = Server.MapPath("indexcount.txt")
Dim strCounterContents AsString
Dim nCounter As Int32
If (File.Exists(strPath)) Then
ctrFile = File.OpenText(strPath)
strCounterContents = ctrFile.ReadLine().ToString()
ctrFile.Close()
nCounter = Convert.ToInt32(strCounterContents)
Else
nCounter = 0
EndIf
nCounter += 1
ctrFileW = New FileStream(strPath, FileMode.OpenOrCreate, FileAccess.Write)
sw = New StreamWriter(ctrFileW)
sw.WriteLine(Convert.ToString(nCounter))
sw.Close()
ctrFileW.Close()
Return nCounter
EndFunction
My question is, is there any simple way to modify this to have the number of hits stored in a database?
If you can get a copy of the windows 98 cd, Dell should have the drivers for your system on their site.
illusion -> effects
When I awoke
(lol this is starting to get like IM)
mouse -> optical
ninja -> scroll
I promptly fainted.
yoga -> ninjitsu
little -> brother
, which wasn't cool.
:D thanks Paladine, glad I could help!
Hey, this could go one of two ways. I want a rich text editor for my website, the information typed into the text editor will be saved to an sql server database under either char or varchar format that supports up to 8000 characters per field. I want it to save as html code. This content will then be pulled from the database to be displayed in a label. Now my question is, what is a good vb .net html rich text editor (must be free) OR how can I make one for vb .net (preferred).
Thanks guys, Slade.
Well I worked it out, here is how it's done.
The following is the html code.
<TITLE [b]ID=pageTitle RUNAT=server[/b]> </TITLE>
Then the vb .net code:
Public Class MyPage
Inherits System.Web.UI.Page
[b]Protected pageTitle As System.Web.UI.HtmlControls.HtmlGenericControl[/b]
Private Sub Page_Load(ByVal sender As System.Object, _ByVal e As System.EventArgs) Handles MyBase.Load
[b]pageTitle.InnerText = "Dynamic page Title"[/b]
End Sub
End Class
Anyways, just thought I'd share my findings with you guys.
Slade
A friend told me that it is possible to change the header of a html web page using the vb .net code. Is this true? If so how do you do it?
ok, I've heard of this mod_rewrite. Is it possible to do this in asp .net using vb .net? It basically just renames a page with a query string such as newthread.php?do=newthread&f=18 to newthread.html, so that search engines have fun and you get ranked high!
Thanks In advance.
Slade
lol cool. I read somewhere it can be done in asp .net so hopefully... anyways, I'm heading over to the asp forums to post my question on how to do it. Thanks for the help! If anyone has anymore suggestions please post thanks.
Slade
use static links that end in .htm or .html.
use mod_rewrite to "cover-up" your dynamic pages.
mod_rewrite... how do I do that? Also, I am designing my site in asp .net, I notice on these forums you've used php, is it possible for me to make "Test.aspx" appear as "Test.Html" but still remain an aspx page? Or is that the function of mod_rewrite?
hill -> freelancer