الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

عمل login و ربطها ب access database

مغلق
بدأه mooj22 في 13 مايو 2007 · 4 رد · 950 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

أنا عملت في موقعي login و ربطتها بموقعي ولكن للأسف كانت SQL هل في إمكانية إني اعمل login بطريقة سهلة بس يكون Access database

أنا استخدم visual studio 2005 و عملته عن طريق website adminstrator

المشكلة ان الاستضافة موفرتلي قاعدة بينات وحدة من SQL و انا للاسف استعملتها

#3

شكرا Miss-Hearts

ولكن أنا أقصد اني استخدم الخاصية الجديدة الموجودة في ASP.NET 2.0 و هي membership, role and profile بطريقتها السهلة و لكن قاعدة البيانات يجب أن تكون Access

#4

salamo 3aliekom

how r you mr mooj22

i understand your question

microsoft had mad the login controls which mad the security part in any web site very easy to implement

but there is a problem which is : microsoft mad the login controls work with a custom database created automatically just when you use asp.net configuration wesite which is separated from your database

so when you want to use these controls you have to implement the membershipprovider and roole provider

follow these links and you will find what you want

membership provider

http://msdn2.microsoft.com/en-us/library/ms366730.aspx

Role provider

http://msdn2.microsoft.com/en-us/library/317sza4k.aspx

Mohammed Al maghraby

Software Developer

thanks

Kind Regards

Mohammed Al maghraby

Software Developer

Mobile : 016 333 658 1

#5

شكراً أخ محمد عبدالحليم على الرد ... شكله الموضوع معقد

المهم انا جربت اعمل طريقة موقع http://www.sitepoint.com/article/securing-...ords-database/2 اللي اعطاني اياه Miss-Hearts

المهم كل شي مشى معي تمام بس المشكلة بعد ما اضغط على زر الدخول لا يرجعني الى الصفحة المطلوبة

لتوضيح أكثر حاولت أن أدخل صفحة الادارة و بعدين طلعت صفحة تطالبني باسم المستخدم و رمز المرور بعد ما ادخلت المعلومات و ضغطت على زر الدخول لاشي يحدث

هذا اهو الكود

Function CheckCredentials(ByVal Username As String, ByVal Password As String) As Boolean

constr = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=" & Server.MapPath("Customers.mdb")

objConn.ConnectionString = constr

objConn.Open()

objCmd = New OleDbCommand("SELECT Salt, Pass FROM Users WHERE Username=@givenUsername", objConn)

objCmd.Parameters.AddWithValue("@givenUsername", Username)

objDR = objCmd.ExecuteReader()

If Not objDR.Read() Then

Return False

Else

Dim strSalt As String = objDR("Salt")

Dim strStoredPassword As String = objDR("Pass")

Dim strGivenPassword As String = FormsAuthentication.HashPasswordForStoringInConfigFile(strSalt & Password, "SHA1")

Return strStoredPassword = strGivenPassword

End If

End Function

Protected Sub btnCheck_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCheck.Click

If (CheckCredentials(txtUsername.Text, txtPassword.Text) = True) Then

Response.Redirect(Request.QueryString("ReturnUrl"))

lblCheck.Text = "You entered the right credentials!"

Else

lblCheck.Text = "You entered the wrong credentials!"

End If

End Sub

هذا الموضوع مغلق.

مواضيع مشابهة