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

ASP with dll files

مغلق
بدأه رواد في 7 ديسمبر 2002 · 3 رد · 512 مشاهدة · في منتدى تصميم صفحات الويب
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

كل عام وجميع السادة أعضاء المنتدى بالف خير :cool:

عندي بعض الاستفسارات بخصوص موضوع التعامل مع ملفات dll بلغة asp واحب اوضح ان dll فقط ملفات للقراءة لكنها تمتاز بقوة كبيرة انا لا أجد مشكلة في التعامل مع dll لكن تماما ما هو مستوى الحماية والامن في هذه الملفات وهل يستطيع أحد الوصول إليها فقد شاهدت بعض مواقع تستخدم class داخل ملفات dll اعتقد انها قوية جدا أيضا الاهم من ذلك ما هو الفرق بين دوال ممكن ابرمجها واكتبها في ملف dll واستدعيها وامرر لها parameters وبين ملف ممكن نعطيه امتداد inc ويكون بداخله دوال كتيرة

وهذا الموقع بيستخدم class in dll files ممكن تطلعوا عليه www.sessions.edu

واسف لأني طولت عليكم شوي

رواد خميس حماد

#2

These are called COM objects.You can develop them using Visual Basic ,Visual C++,or Visual Borland C++.You can do anything you want using COM from business modelling to database access.For instance ,if you are going to create an online store ,you can model Customer,Product,Shopping Cart,Order as a VB classes inside your dll and then access them from ASP.

COM dll are secure because the code is compiled and also because these objects can not be manipulated unless the dll is registered on the server,while the inc files are vulnerable to internet threats .

You can not use COM objects from asp if you do not have access to the server,because you need to register the dll.

#3

السلام عليكم

شكرا لك سيد مدني لكني كننت أرغب باستيفاء الموضوع بشكل أكبر إذا ممكن كان عند حضرتك بعض الروابط او المراجع

رواد خميس حماد

#4

These articles are helpful:

http://www.microsoft.com/mind/0999/vbcom/vbcom.asp

http://www.15seconds.com/issue/980930.htm

http://www.15seconds.com/issue/971214.htm

http://www.15seconds.com/issue/010730.htm

http://www.microsoft.com/msj/defaultframe....0498/newnav.htm

ASPTODAY has loads of articles about ASP COM programming:

www.asptoday.com

And COM section : http://www.microsoft.com/com

If you are looking for a practical example this one will help you get you started:

Create a "ActiveX dll" project in Visual Basic 6.Rename the project "MyProject" and the class "Customer" using the properties window.

write the following code :

Private v_name As String

Private v_address As String





Public Property Get Name() As String

Name = v_name

End Property



Public Property Get Address() As String

Address = v_address

End Property



Public Property Let Name(ByVal p_name As String)

v_name = p_name

End Property



Public Property Let Address(ByVal p_address As String)

v_address = p_address

End Property

As you can see ,we created a class to represent a customer with the properties name and address.Compile and then register the dll using:

regsvr32 MyProject.dll

Now create an asp page and type:

'initialise the customer object

Set Customer = Server.CreateObject("MyProject.Customer")

'set the name

Customer.Name = "Ahmed"

'set the address

Customer.Address = "255 , King Street London"

'now we test the properties by displaying the name and address



Response.write "The customer name is " & Customer.Name & " and his address is " & Customer.Address & "
"

If we were going to save this data to a SQL Server ,or Access database ,we could just add a function to our Visual Basic class like :

Function Create() As Boolean



Dim rs as new RecordSet

Set rs = new RecordSet

rs.open "select*from Customers",Con,3,3



rs.AddNew

rs("Name") = Me.Name

rs("Address") = Me.Address

rs.Update

rs.close



Create = True



End Function

And then call this function from ASP

Customer.Create

This function will add the new customer to the database.

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

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