ฉันเห็นระบบการเงินบนเว็บบนอินเทอร์เน็ตในช่วงเหตุการณ์ มันถูกนำไปใช้ผ่าน ActiveX ในความเป็นจริงหากคุณใช้ Webservice เพื่อรวม DHTML คุณสามารถใส่ ActiveX ได้อย่างสมบูรณ์ นี่คือตัวอย่างง่ายๆ
ก่อนอื่น Webservice ซึ่งง่ายมากฉันจะไม่อธิบายรายละเอียดเพียงแค่ดูความคิดเห็น
file study.asmx.cs
ใช้ระบบ
ใช้ System.collections;
ใช้ System.ComponentModel;
ใช้ System.data;
ใช้ System.diagnostics;
ใช้ System.web;
ใช้ System.web.services;
ใช้ System.xml.serialization;
Namespace chestressxml
-
/// <summary>
/// <br> ตัวอย่างของเว็บเซิร์ฟเวอร์ </br>
/// <br> ผู้แต่ง: [อีเมลป้องกัน] </br>
/// <br> วันที่: 2001/12/21 </br>
/// <br> ประวัติ: เสร็จสมบูรณ์ในปี 2001 // 12/14 </br>
/// </summary>
/// <ข้อเสนอ>
/// ฟังก์ชั่นที่ใช้โดยเว็บไซต์นี้ง่ายมาก
/// มีสองฟังก์ชั่นหลักหนึ่งคือหนึ่งคือการได้รับอาร์เรย์รายการที่กำหนดไว้ล่วงหน้า
/// อื่นคือการบันทึกบันทึกประเภทบันทึก
/// </lemarks>
การศึกษาระดับสาธารณะ: System.web.services.webservice
-
arraylist ส่วนตัว m_arrites;
arraylist ส่วนตัว m_arrreocrds;
การศึกษาสาธารณะ ()
-
// codegen: การโทรนี้เป็นสิ่งจำเป็นโดยนักออกแบบ Web Services ASP.NET
เริ่มต้นคอมเพล็กซ์ ();
this.m_arrreocrds = new ArrayList ();
this.m_arrites = new ArrayList ();
// เพิ่มข้อมูลการทดลองบางอย่าง
สำหรับ (int i = 0; i <100; i ++)
-
this.m_arrites.add (รายการใหม่ (itemname + i.toString ()
, itemValue + (i + 1) .toString ()));
-
-
/// <summary>
-
/// </summary>
/// <param name = a_stritemname> ชื่อรายการ </param>
/// <returns> รายการรายการ </returns>
รายการส่วนตัว getItem (สตริง a_stritemname)
-
// throw (ข้อยกเว้นใหม่ (server.urldeCode (a_stritemname)))));
สำหรับ (int i = 0; i <this.m_arrites.count; i ++)
-
รายการ item = (รายการ) this.m_arrites [i];
if (item.name == server.urldeCode (a_stritemname) .Trim ())
-
รายการส่งคืน;
-
-
คืนค่า null;
-
#region component designer สร้างรหัส
// ต้องการโดยนักออกแบบบริการเว็บ
ส่วนประกอบ iContainer ส่วนตัว = null;
/// <summary>
/// วิธีการที่จำเป็นสำหรับการสนับสนุนผู้ออกแบบ - อย่าแก้ไข
/// เนื้อหาของวิธีนี้กับตัวแก้ไขรหัส
/// </summary>
โมฆะส่วนตัวเริ่มต้นคอมเม้นต์ ()
-
-
/// <summary>
/// ทำความสะอาดทรัพยากรใด ๆ ที่ใช้
/// </summary>
เป็นโมฆะที่ได้รับการป้องกันการแทนที่ (การกำจัดบูล)
-
ถ้า (กำจัด && ส่วนประกอบ! = null)
-
ส่วนประกอบ. dispose ();
-
base.dispose (กำจัด);
-
#endregion
[WebMethod]
โมฆะสาธารณะ additem (สตริง a_strname, สตริง a_strvalue)
-
this.m_arrites.add (รายการใหม่ (a_strname, a_strvalue));
-
/// <summary>
/// รับรายการรายการ
/// </summary>
/// <returns> arraylist </returns>
[WebMethod]
[xmlinclude (typeof (item))]]
public arraylist getItems ()
-
ส่งคืนสิ่งนี้ m_arrites;
-
/// <summary>
/// บันทึกบันทึก
/// </summary>
/// <param name = a_stritemname> </param>
/// <param name = a_strdemoname> </param>
/// <param name = a_intdemoamount> </param>
/// <returns> หากประสบความสำเร็จให้ส่งคืนเท็จมิฉะนั้น </returns>
[WebMethod]
saverecord สาธารณะบูล (สตริง a_stritemname
, สตริง a_strdemoname, int a_intdemoamount)
-
พยายาม
-
รายการ item = this.getItem (a_stritemname);
ถ้า (รายการ! = null)
-
this.m_arrreocrds.add (บันทึกใหม่ (this.m_arrreocrds.count + 1
, รายการ
, การสาธิตใหม่ (a_strdemoname, a_intdemoamount))));
-
อื่น
-
Throw (ข้อยกเว้นใหม่ (ข้อผิดพลาดชื่อสำหรับการระบุรายการ!));
-
กลับมาจริง;
-
จับ (ข้อยกเว้น e)
-
โยน (ข้อยกเว้นใหม่ (e.toString ())));
// return false;
-
} // วิธีการสิ้นสุด
} // คลาสสิ้นสุด
/// <summary>
/// คลาสง่าย ๆ ที่สอดคล้องกับตัวเลือกเช่นเลือก
/// </summary>
รายการชั้นเรียนสาธารณะ
-
สตริงส่วนตัว m_strname;
สตริงส่วนตัว m_strvalue;
ชื่อสตริงสาธารณะ
-
รับ
-
ส่งคืนสิ่งนี้ m_strname;
-
ชุด
-
this.m_strname = value;
-
-
ค่าสตริงสาธารณะ
-
รับ
-
ส่งคืนสิ่งนี้ m_strvalue;
-
ชุด
-
this.m_strvalue = ค่า;
-
-
รายการสาธารณะ (สตริง a_strname, string a_strvalue)
-
this.m_strname = a_strName;
this.m_strvalue = a_strvalue;
-
รายการสาธารณะ ()
-
this.m_strname =;
this.m_strvalue =;
-
} // คลาสสิ้นสุด
/// <summary>
/// คลาสตัวอย่างง่ายๆ
/// โครงสร้างนั้นง่ายมากตัวแปรสมาชิกสามตัว
/// จำนวน int จำนวนหนึ่ง
/// ประเภทรายการประเภทตัวอย่าง
/// </summary>
บันทึกชั้นเรียนสาธารณะ
-
int ส่วนตัว m_intid;
รายการส่วนตัว m_objmyitem;
การสาธิตส่วนตัว m_objmydemo;
บันทึกสาธารณะ ()
-
this.m_intid = 0;
this.m_objmydemo = demo ใหม่ ();
this.m_objmyitem = รายการใหม่ ();
-
บันทึกสาธารณะ (int a_intid, รายการ a_objitem, demo a_objdemo)
-
this.m_intid = a_intid;
this.m_objmydemo = a_objdemo;
this.m_objmyitem = a_objitem;
-
} // สิ้นสุด cals
/// <summary>
/// คลาสตัวอย่างง่ายๆ
/// โครงสร้างนั้นง่ายมากโดยมีตัวแปรสมาชิกเพียงสองตัวชื่อหนึ่งชื่อและหนึ่งจำนวน
/// </summary>
การสาธิตชั้นเรียนสาธารณะ
-
สตริงส่วนตัว m_strname;
int ส่วนตัว m_intamount;
ชื่อสตริงสาธารณะ
-
รับ
-
ส่งคืนสิ่งนี้ m_strname;
-
ชุด
-
this.m_strname = value;
-
-
จำนวน Int สาธารณะ
-
รับ
-
ส่งคืนสิ่งนี้ m_intamount;
-
ชุด
-
this.m_intamount = ค่า;
-
-
/// <summary>
/// ตัวสร้าง
/// </summary>
การสาธิตสาธารณะ ()
-
this.m_intamount = 0;
this.m_strname =;
-
/// <summary>
/// overload constructor
/// </summary>
/// <param name = a_strName> </param>
/// <param name = a_intamount> </param>
การสาธิตสาธารณะ (สตริง a_strname, int a_intamount)
-
this.m_intamount = a_intamount;
this.m_strname = a_strName;
-
} // คลาสสิ้นสุด
} // สิ้นสุดเนมสเปซ