aCloud: 云中的阿拉伯网络操作系统

aCloud是首个为阿拉伯人设计的基于云的网络操作系统(WebOS),它基于Silverlight 4技术构建,是继SilveOS之后第二个采用该技术的云系统。网络操作系统,也称为WebTop,是一种虚拟操作系统,可以在网络浏览器中运行。aCloud是一个简单的网络操作系统,运行在云端,通过它,用户可以编辑文档、撰写和发送邮件、使用日历、通讯录等。网络操作系统并非真正的操作系统,而是一种应用程序,用户可以通过浏览器在互联网上使用这些基本的日常应用程序。

网络操作系统可以分为多个类别:

  • 自托管网络操作系统,如eyeOS
  • 远程桌面,如Widgeop
  • 远程托管网络操作系统,如ghost WebOS

云计算是一种基于互联网的计算方式,它按需向计算机和其他设备提供共享资源、软件和信息,就像电力网一样。云是一组服务器的集合,用户与云交互时无需担心其实现方式。

云计算有三种类型:

  • 基础设施即服务(IaaS)
  • 平台即服务(PaaS)
  • 软件即服务(SaaS)

aCloud基于三层架构:

  1. 表示层:由Silverlight用户控件组成,构成整个Web桌面的图形用户界面(GUI)。
  2. 业务逻辑层:一个简单的Web服务,包含实现系统核心功能的代码。
  3. 数据层:一个简单的XML文件,包含有关当前aCloud用户的信息。

以下是一个名为Card的用户控件示例,它包含有关当前云用户的个人信息。

<UserControl x:Class="aCloud.Card" ...> <Grid x:Name="LayoutRoot"> <Border ...> <Border.Background> <ImageBrush ImageSource="/aCloud;component/Images/Profile.png" /> </Border.Background> </Border> <TextBlock ...>إسم المستخدم</TextBlock> <TextBlock ...>آخر دخول: 00/00/0000</TextBlock> <TextBlock ...>عدد مرات الدخول: 00000</TextBlock> </Grid> </UserControl>

Card.xaml.vb文件定义了Card控件的后端逻辑,包括属性和事件处理程序。

Imports System.Windows.Media.Imaging Imports System.IO Imports aCloud.aCloudService Partial Public Class Card Inherits UserControl Dim MyService As New aCloudServiceSoapClient() Public Sub New() InitializeComponent() End Sub Public Property Picture As String Get Return Nothing End Get Set(ByVal value As String) Dim brush As New ImageBrush() brush.ImageSource = New BitmapImage(New Uri(value)) PictureBorder.Background = brush End Set End Property Public Property Username As String Get Return UsernameTextBlock.Text End Get Set(ByVal value As String) UsernameTextBlock.Text = value End Set End Property Public Property LastLoginDate As String Get Return LastLoginDateTextBlock.Text End Get Set(ByVal value As String) LastLoginDateTextBlock.Text = String.Format("آخر دخول: {0}", value) End Set End Property Public Property LoginsNo As String Get Return LoginsNoTextBlock.Text End Get Set(ByVal value As String) LoginsNoTextBlock.Text = String.Format("عدد مرات الدخول: {0}", value) End Set End Property Private Sub PictureBorder_MouseLeftButtonUp(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles PictureBorder.MouseLeftButtonUp Dim ofd As New OpenFileDialog() ofd.Filter = "Image Files |*.jpg;*.png;*.bmp;*.gif" ofd.Multiselect = False If ofd.ShowDialog() Then Dim bi As New BitmapImage() Dim data(ofd.File.Length) As Byte ofd.File.OpenRead().Read(data, 0, data.Length) MyService.UploadAsync(String.Format("aCloud Users/{0}/Picture.jpg", User.ID), data) bi.SetSource(ofd.File.OpenRead()) Dim img As New ImageBrush() img.ImageSource = bi PictureBorder.Background = img End If End Sub End Class

业务逻辑层中有许多函数提供了aCloud的基本功能。以下是一些示例:

<WebMethod()> _ Public Function GetDirectories(ByVal FullName As String) As List(Of String) Dim contents As New List(Of String) Dim path As String = Server.MapPath(FullName) For Each directory In New DirectoryInfo(path).GetDirectories() contents.Add(<Directory ID=<%= directory.FullName.Substring_(directory.FullName.IndexOf("aCloud Users")) %>> <Name><%= directory.Name %></Name> <Items><%= Convert.ToBoolean(directory.GetDirectories().Count + directory.GetFiles().Count) %></Items> </Directory>.ToString()) Next Return contents End Function <WebMethod()> _ Public Sub DeleteFile(ByVal FullName As String) Dim path As String = Server.MapPath(FullName) File.Delete(path) End Sub <WebMethod()> _ Public Sub CreateDirectory(ByVal FullName As String) Dim path As String = Server.MapPath(FullName) Directory.CreateDirectory(path) End Sub <WebMethod()> _ Public Sub Upload(ByVal FullName As String, ByVal data As Byte()) File.WriteAllBytes(HttpContext.Current.Server.MapPath(FullName), data) End Sub <?xml version="1.0" encoding="utf-8" ?> <Users> <User ID="6451be9f-8a63-409d-87c9-af6c14305fe3"> <Name>admin</Name> <Password>123</Password> <CreationDate>4/3/2011</CreationDate> <LastLoginDate>4/3/2011</LastLoginDate> <LoginsNo>1</LoginsNo> <Status>Offline</Status> </User> <User ID="86612741-dd32-4d3a-bf16-d8fad6c3f2d0"> <Name>demo</Name> <Password>demo</Password> <CreationDate>4/3/2011</CreationDate> <LastLoginDate>4/16/2011</LastLoginDate> <LoginsNo>235</LoginsNo> <Status>Offline</Status> </User> <User ID="83c5dff7-00dd-47b3-a63b-750677421220"> <Name>test</Name> <Password>test</Password> <CreationDate>4/16/2011</CreationDate> <LastLoginDate>4/25/2011</LastLoginDate> <LoginsNo>12</LoginsNo> <Status>Offline</Status> </User> </Users>
沪ICP备2024098111号-1
上海秋旦网络科技中心:上海市奉贤区金大公路8218号1幢 联系电话:17898875485