• vs2010+Silverlight4+WCF开发部署全过程(转)


    1 安装开发环境 操作系统:Windows 7 专业版 微软先锋计划199元购 Vs2010:cn_visual_studio_2010_ultimate_x86_dvd_532347.iso这是微软送的一个版本,先前在微软下载的。 银光套件:Silverlight.exe Silverlight4_Tools.exe Silverlight_Developer.exe 2 安装 依次安装
      

      1 安装开发环境

      操作系统:Windows 7 专业版 微软先锋计划199元购

      Vs2010:cn_visual_studio_2010_ultimate_x86_dvd_532347.iso这是微软送的一个版本,先前在微软下载的。

      银光套件:Silverlight.exe

      Silverlight4_Tools.exe

      Silverlight_Developer.exe

      2 安装

      依次安装:vs2010,完全安装

      Silverlight.exe

      Silverlight4_Tools.exe

      Silverlight_Developer.exe,按微软说的只要安装了Silverlight4_Tools.exe,就不用安装Silverlight_Developer.exe,但是在调试程序还是要我安装Silverlight_Developer,我就有安装了它。

      3 建立一个vs2010+silverlight4+wcf的项目

      为了少啰嗦,大家看图吧。







    silverlight项目中的脚本 XML code UserControl x:Class=SilverlightApplication1.MainPage xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/x
      




      

      

      

      silverlight项目中的脚本

    XML code

    UserControl x:Class="SilverlightApplication1.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"><StackPanel ><TextBlock x:Name="text_result" Text="显示结果"></TextBlock><Button x:Name="button_get_welcome" Content="测试wcf" Width="100" Click="button_get_welcome_Click"></Button></StackPanel></Grid></UserControl>
    
    
    

    后台代码:

    VB.NET code
    PartialPublicClass MainPage Inherits UserControl Private wcf AsNew ServiceReference1.Service1Client PrivateSub wcf_get_wcf_welcomeCompleted(ByVal s AsObject, _ ByVal e As ServiceReference1.get_wcf_welcomeCompletedEventArgs) text_result.Text = e.Result End SubPublicSubNew() InitializeComponent() AddHandler wcf.get_wcf_welcomeCompleted, AddressOf wcf_get_wcf_welcomeCompleted End SubPrivateSub button_get_welcome_Click(ByVal sender As System.Object, _ ByVal e As System.Windows.RoutedEventArgs) wcf.get_wcf_welcomeAsync() End SubEnd Class

    wcf中添加的一段代码:

    VB.NET code
    <OperationContract()>PublicFunction get_wcf_welcome() AsStringReturn"欢迎连接wcf成功。"End Function

    这是一个部署和使用成功的项目,不好意思是vb代码,不过不影响整个过过程。

      第20-22张图注释:

      在项目文件下有一个SetupMySilverlight4文件夹

      第23-24张图注释:

      要想正确执行:SetupMySilverlight4\debug\setup.exe,必须做的一个设置。不知道微软为什么要让用户这样做,而没有设成默认值。

      安装后,在浏览器上的执行地址是:

      http://192.168.1.x/SetupMySilverlight4/SilverlightApplication1TestPage.aspx

     转自:http://www.silverlightchina.net/html/tips/2011/0418/7002.html

  • 相关阅读:
    [Maid] Write Tasks in Markdown with Maid
    [React] Preview and edit a component live with React Live
    [React] Build a slide deck with mdx-deck using Markdown + React
    [React] Spread Component Props in JSX with React
    重载new delete操作符是怎么调用的
    oracle如何设置show parameter显示隐含参数
    Google用户登录界面 Android实现
    Jquery 动态生成表单 并将表单数据 批量通过Ajax插入到数据库
    消息机4_B
    jQuery中对 input 控件的操作
  • 原文地址:https://www.cnblogs.com/cuihongyu3503319/p/2237178.html
Copyright © 2020-2023  润新知