Silverlight(22) - 2.0通信之调用WCF服务, 对传输信息做加密
2008-12-18 11:54:27 来源:WEB开发网WCFService.cs(WCF 服务)
using System;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.IO;
/**//// <summary>
/// 提供 WCF 服务的类
/// </summary>
[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class WCFService
{
/**//// <summary>
/// 返回指定的 User 对象(用于演示 Silverlight 调用 WCF 服务)
/// </summary>
/// <param name="name">名字</param>
/// <returns></returns>
[OperationContract]
public User GetUser(string name)
{
return new User { Name = name, DayOfBirth = new DateTime(1980, 2, 14) };
}
}
WCF.xaml
<UserControl x:Class="Silverlight20.Communication.WCF"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Left" Margin="5">
<TextBlock x:Name="lblMsg" />
</StackPanel>
</UserControl>
Tags:Silverlight 通信 调用
编辑录入:爽爽 [复制链接] [打 印]- ››silverlight全屏显示图片
- ››Silverlight MVVM 模式(一) 切近实战
- ››调用已注册会员人数和最新会员名称
- ››Silverlight for Windows Phone 7开发系列(1):...
- ››Silverlight for Windows Phone 7开发系列(2):...
- ››Silverlight for Windows Phone 7开发系列(3):...
- ››Silverlight for Windows Phone 7开发系列(4):...
- ››Silverlight for Symbian
- ››调用android系统自带功能
- ››调用HHA_CompileHHP编译chm工程
- ››调用所有的 android activity 的实现
- ››调用 Android 内置图片的方法
更多精彩
赞助商链接