WEB开发网
开发学院图形图像Flash Silverlight(22) - 2.0通信之调用WCF服务, 对传输... 阅读

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.Activa

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>

上一页  1 2 3 4 5  下一页

Tags:Silverlight 通信 调用

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接