WebForm demo, simulating mobile phone Usb interface charging, webformdemo

Source: Internet
Author: User
Tags iusb

WebForm demo, simulating mobile phone Usb interface charging, webformdemo

MATERIALS: Mobile, MiniCharger, IUsb ),

Design Concept:

1. Declare the interaction mode between IUsb objects, including an event;

2. Mobile implements the IUsb interface, which is the key point. It is the interface implemented by the caller and needs to be delegated to the charging device through the event;

3. Mobile reflection charging device, injecting IUsb through constructor;

Code List:

1 public interface IUsb {2 decimal Voltage {get; set;} 3 event System. EventHandler Connecting; 4}IUsb. cs 1 <% @ Page Language = "C #" AutoEventWireup = "true" CodeFile = "Mobile. aspx. cs" Inherits = "Mobile" %> 2 3 <! DOCTYPE html> 4 5 I just wrote a skeleton. If you are interested, you can implement several different types of Usb devices,
In addition, you can try to extend the functions of the Usb interface, such as adding the data copy function to the mobile phone,

See the different effects of connecting a laptop to a charger

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.