摘要: In this post I am going to look at comparing four technologies that can be used to build business applications easily. This post was inspired by how similar a number of products have become over the last few years and more importantly how the new kid on the blockVisual Studio Lightswitch, which is .阅读全文
posted @ 2011-05-31 16:50 rapid 阅读(72) 评论(0) 编辑

Microsoft Office Communications Server 2007 R2 (OCS 2007 R2)服务器端

http://www.microsoft.com/downloads/details.aspx?FamilyID=67a3de72-7dbd-4e0b-92a5-29d0b46009a7&DisplayLang=en

Microsoft Office Communicator 2007 R2 (OC 2007 R2)客户端

http://www.microsoft.com/downloads/details.aspx?FamilyID=535637af-d92f-41b1-bf0c-54a526a88247&DisplayLang=en

Microsoft Office Communications Server 2007 R2 Group Chat server 组消息服务器端

http://www.microsoft.com/downloads/details.aspx?FamilyID=284e27ee-28a3-4fd5-9515-b90b609cedc4&DisplayLang=en

Microsoft Office Communications Server 2007 R2, Group Chat Administration Tool 组消息管理工具

http://www.microsoft.com/downloads/details.aspx?FamilyID=8c1b742c-48a8-45ef-beaa-d6340b97bdb7&DisplayLang=en

Microsoft Office Communications Server 2007 R2 Group Chat client 组消息客户端

 http://www.microsoft.com/downloads/details.aspx?FamilyID=2ac20539-5b4f-4fd0-88b3-b343a439d576&DisplayLang=en

Microsoft Office Communications Server 2007 R2 Attendant 助理操作台,客户端

http://www.microsoft.com/downloads/details.aspx?FamilyID=3d619c8c-6540-4f2d-b78e-5b4c25780adb&DisplayLang=en

Office Communications Server 2007 R2 Attendant Training 助理操作台学习文件

http://www.microsoft.com/downloads/details.aspx?FamilyID=92ae62f2-5fb4-43da-a98c-9dff32ea97fa&DisplayLang=en

Microsoft Office Communicator Mobile 2007 R2 手机客户端

http://www.microsoft.com/downloads/details.aspx?FamilyID=93062936-f216-4d97-aa13-105a20454322&DisplayLang=en

Microsoft Unified Communications Managed API 2.0 SDK (32 bit)

 http://www.microsoft.com/downloads/details.aspx?FamilyID=768efa33-6606-4b2b-809a-6c69274621d3&DisplayLang=en

Microsoft Unified Communications Managed API 2.0 SDK (64 bit)

http://www.microsoft.com/downloads/details.aspx?FamilyID=b20967b1-6cf5-4a4b-b7ae-622653ac929f&DisplayLang=en

Microsoft Office Communications Server 2007 R2 UCMA 2.0 Speech Language Packs

http://www.microsoft.com/downloads/details.aspx?FamilyID=30e14c5a-a42c-4d4e-9513-c4b0b8d21086&DisplayLang=en

posted @ 2010-10-26 12:00 rapid 阅读(82) 评论(0) 编辑

【更改】,之前上传的下载链接有误,这是新的链接:all-silverlight-vedios-new.rar

 

Silverlight官网提供了许多的视频,也提供了下载地址,然而一个一个打开网页下载,470多个视频需要多长时间?

既然我们都是程序员,当然要找个办法批量下载。

这是我找出的地址:

 

[文件下载]  sl批量下载URL.rar

 

现在来说说如何下载,以下2种方法解决问题

最开始的想法:

1、“爬”网页

既然网页提供下载,那只要“爬”每个SL视频网页,然后用正则解析,自然就OK了。

首先打开SL视频的网页:http://silverlight.net/learn/videos/all/

这里显示了所有SL视频,右键点击,查看网页源代码,看到所有视频的地址都是这样的

 

<href="/learn/videos/all/http-request-with-httpwebrequest">....

 

 

现在就该上程序,找出所有的地址了

 

Regex reg = new Regex("<a href=\"(/learn/videos/all/\\S+)\">");
var match 
= reg.Match(html);
while (match.Success)
{
    
//anchors.Add(match.Value);
    anchors.Add("http://silverlight.net" + match.Groups[1].Value);
    match 
= match.NextMatch();
}

 

 

这是我找出的所有连接地址

http://silverlight.net/learn/videos/all/Basic-Animation-Silverlight-3
http://silverlight.net/learn/videos/all/RichTextArea-Part-2
http://silverlight.net/learn/videos/all/Duplex-Services-in-Silverlight-3
http://silverlight.net/learn/videos/all/Change-Styles-Runtime-Silverlight-3
http://silverlight.net/learn/videos/all/Use-Isolated-Storage-SL3-Out-of-Browser
http://silverlight.net/learn/videos/all/Out-Of-Stream-Data-Access
http://silverlight.net/learn/videos/all/Access-Web-Camera-Microphone
http://silverlight.net/learn/videos/all/BiDi-Right-to-Left
http://silverlight.net/learn/videos/all/Right-Click-Mouse-Events
http://silverlight.net/learn/videos/all/Building-Custom-Bitrate-Meter
http://silverlight.net/learn/videos/all/Creating-Custom-Timeline-Markers
http://silverlight.net/learn/videos/all/Hosting-HTML-Content
http://silverlight.net/learn/videos/all/Using-the-ViewBox-Control
http://silverlight.net/learn/videos/all/Accessing-Global-Clipboard
http://silverlight.net/learn/videos/all/Notification-API
http://silverlight.net/learn/videos/all/MouseWheel-API

....

 

 

既然找出了SL视频的详细页地址,然后就是对每个页面“爬网”了,这里我们采用异步方法,提高效率

 

 

public static ManualResetEvent _allDone = new ManualResetEvent(false);

public static void Download()
{
    var url 
= "";
    
using (StreamReader reader = new StreamReader("all-silverlight-vedio-detail-url"))
    {
        url 
= reader.ReadToEnd();
    }

    var urlArray 
= url.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
    _totalFiles 
= urlArray.Length;

    
for (int i = 0; i < _totalFiles; i++)
    {
        var request 
= HttpWebRequest.Create(urlArray[i]);
        request.BeginGetResponse(ResponseCallback, request);
    }

    _allDone.WaitOne();
}

static int _totalFiles;
static int _filesFlag;

private static void ResponseCallback(IAsyncResult asynchronousResult)
{
    var request 
= (WebRequest)asynchronousResult.AsyncState;
    var response 
= request.EndGetResponse(asynchronousResult);
    var stream 
= response.GetResponseStream();
    
using (StreamReader reader = new StreamReader(stream))
    {
        var name 
= GetFileNameFromUri(request.RequestUri.AbsolutePath);
        var html 
= reader.ReadToEnd();
        
using (StreamWriter writer = new StreamWriter("D:\\silverlight-vedios\\" + name))
            writer.Write(html);
    }

    _filesFlag
++;
    
if (_filesFlag == _totalFiles)
        _allDone.Set();
}

private static string GetFileNameFromUri(string p)
{
    var i 
= p.LastIndexOf('/');
    var s 
= p.Substring(i + 1);
    
return s;
}

 

 

下载完所有视频网页之后,就要开始对网页进行分析,提取所有WMV视频,代码略

 

以上方法看似很完美了,可是我们仍然要采用第二种方法,

如果大家试过之后就会知道,微软给出的下载视频网址,很多是失效的链接

视频470多个,而找出的视频下载地址只有380多个

 

2、从微软提供的web service下载

思路:SL播放器肯定是通用的,想想微软也不可能为每个视频做个播放器

既然播放器通用,那肯定有地方获取要播放的视频地址

思路有了,那我们就要从SL播放器下手。

 

打开任意一个SL视频网页,然后查看源代码,我们可以看到这么一段

 

<object id="slMediaPlayer" style="width:400px;height:338px" autoupdate="true" data="data:application/x-silverlight-2," type="application/x-silverlight-2">
    
<param name="MinRuntimeVersion" value="3.0.40624.0" />
    
<param name="source" value="/ClientBin/mediaplayer/MSCommunities.MediaPlayer.xap" />
    
<param name="InitParams" value="videoid=34056,username=Anonymous" />
    
<href="http://go.microsoft.com/fwlink/?LinkId=149156" style="text-decoration:none">
        
<img src="http://i1.silverlight.net/resources/images/content/misc/Install-Silverlight-400x338-VideoSize.png?cdn_id=20091118_3" alt="Please install Silverlight or click download to watch video locally." />
    
</a>
</object>

 

 

上面我着色的地方,就是SL的地址,前面加上网址:http://silverlight.net//ClientBin/mediaplayer/MSCommunities.MediaPlayer.xap

 

下载之后,将XAP的后缀改为ZIP,然后打开,可以看到以下文件

 

 

写过SL程序的人,一看到这些文件应该立刻就明白了,他引用的是WCF服务!!

2个重要的文件,需要我们去看看

1、WCF配置文件:ServiceReferences.ClientConfig

2、播放器DLL文件:MSCommunities.MediaPlayer.dll

 

打开ServiceReferences.ClientConfig,我们可以一眼看到引用的service地址

 

<configuration>
    
<system.serviceModel>
        
<bindings>
            
<basicHttpBinding>
                
<binding name="BasicHttpBinding_MediaPlayer" maxBufferSize="2147483647"
                    maxReceivedMessageSize
="2147483647">
                    
<security mode="None">
                        
<transport>
                            
<extendedProtectionPolicy policyEnforcement="Never" />
                        
</transport>
                    
</security>
                
</binding>
            
</basicHttpBinding>
        
</bindings>
        
<client>
            
<endpoint address="http://www.silverlight.net/services/mediaplayer.svc"
                binding
="basicHttpBinding" bindingConfiguration="BasicHttpBinding_MediaPlayer"
                contract
="Services.Silverlight.MediaPlayer" name="BasicHttpBinding_MediaPlayer" />
        
</client>
    
</system.serviceModel>
</configuration>

 

 

WCF地址:http://www.silverlight.net/services/mediaplayer.svc

我们将这段地址COPY,然后在浏览器中打开,没有加密,能打开,GREAT!

 

然后我们建立一个工程,将这段地址以Service Reference的方式引入,工程类型不限

引入Service之后,我们可以看到几个非常有用的类,其中我们会用到的2个:

MediaPlayerClient (获取VEDIO就靠他了)

VedioInfo (视频对象类,我们会用到它的VideoSourceUri属性)

 

现在开始分析MediaPlayerClient,打开来看到里面有个方法GetVideo,参数是ID和USERNAME,返回值是VedioInfo太好了,方法现成的!

可是ID,和USERNAME,我们到哪儿去找呢?

 

其实对SL程序熟悉的人应该已经知道如何操作了,直接看网页,下面的文章是对不熟悉SL的人讲的。

还记得我上面提到的这个MSCommunities.MediaPlayer.dll 吗

微软的播放器就用它来获取地址的,那这个DLL里面肯定有获取地址的方法,如何找出来呢,上Reflector!

 

用Reflector打开这个DLL

 

 

解释下:

MSCommunities.MediaPlayer:播放器的相关类

MSCommunities.MediaPlayer.Services.Silverlight:SL播放器引用上面的WCF地址的代理类

 

自然,SL播放器也会用到MediaPlayerClient这个类,打开这个类,看到这个方法

 

public void GetVideoAsync(string id, string userName);

 


因为SL引用WCF只能用异步方法

好了,现在我们只要找到SL播放器如何使用这个方法,就知道如何调用了

最简单的方法,导出整个DLL,然后搜索GetVideoAsync这个方法,相信聪明的你肯定能找到这个方法在哪里调用的

 

最后,我们找到这个方法的调用地方,在MSCommunities.MediaPlayer命名空间下的Page类中

 

private void InitGetVideoAsync()
{
    
this.m_service.GetVideoAsync(Application.Current.Resources["VideoID"].ToString(), Application.Current.Resources["UserName"].ToString());
}

 

 

找到了!

它是从这2个地方获取ID和USERNAME的

Application.Current.Resources["VideoID"]  //获取ID

Application.Current.Resources["UserName"]  //获取USERNAME

 

最后,我们只要知道程序在哪里加载这2个信息的就行了

熟悉SL的人肯定一下就能想到是在APP里面加载的

不熟悉的人可以搜索,Application.Current.Resources是ResourceDictionary类型,加载自然会用到Add方法

 

好了,来看看APP类的Application_Startup方法做了什么

 

private void Application_Startup(object sender, StartupEventArgs e)
{
    Application.Current.Resources.Add(
"VideoID", e.InitParams["videoid"]);
    ....
}

 

 

注释:InitParams,获取作为 Silverlight 插件的 HTML 初始化的一部分传递的初始化参数。

即,从网页的<param name="InitParams"获取参数

 

好了,我们再回过头看看最开始的,嵌入SL的部分

 

<object id="slMediaPlayer" style="width:400px;height:338px" autoupdate="true" data="data:application/x-silverlight-2," type="application/x-silverlight-2">
    
<param name="MinRuntimeVersion" value="3.0.40624.0" />
    
<param name="source" value="/ClientBin/mediaplayer/MSCommunities.MediaPlayer.xap" />
    
<param name="InitParams" value="videoid=34056,username=Anonymous" />
    
<href="http://go.microsoft.com/fwlink/?LinkId=149156" style="text-decoration:none">
        
<img src="http://i1.silverlight.net/resources/images/content/misc/Install-Silverlight-400x338-VideoSize.png?cdn_id=20091118_3" alt="Please install Silverlight or click download to watch video locally." />
    
</a>
</object>

 

 

现在看看<param name="InitParams" value="videoid=34056,username=Anonymous" />
看到了吧,vedioid 和 username都在这里了

 

剩下的事情就是利用我们下载的每个视频网页,找出每个视频的ID,然后用MediaPlayerClient下载即可

 

好了,写的有些乱,有什么问题我会及时回复

 

posted @ 2009-12-17 15:00 rapid 阅读(2061) 评论(24) 编辑

由于Scott Gu的Sample中的数据已经不能获取,于是花了点时间把数据获取重写了下

仍然是Linq to XML,具体代码如下

  

XDocument xmlStories = XDocument.Parse(xmlContent);

XNamespace digg = "http://digg.com/docs/diggrss/";

XNamespace media = "http://search.yahoo.com/mrss/";

 

var stories = from story in xmlStories.Descendants("item")

              where story.Element(media + "thumbnail") != null &&

                    story.Element(media + "thumbnail").Attribute("url") != null &&

                    story.Element(media + "thumbnail").Attribute("url").Value.EndsWith(".jpg")

              select new DiggStory

              {

                  //Id = (int)story.Attribute("id"),

                  Title = ((string)story.Element("title")).Trim(),

                  Description = Regex.Replace(((string)story.Element("description")).Trim(), @"<(.[^>]*)>", "", RegexOptions.IgnoreCase),

                  ThumbNail = (string)story.Element(media + "thumbnail").Attribute("url"),

                  HrefLink = new Uri((string)story.Element("link")),

                  NumDiggs = (int)story.Element(digg + "diggCount"),

                  UserName = (string)story.Element(digg + "submitter").Element(digg + "username"),

              };

 

 

 还有一个地方,大家在做这个Demo的时候,注意在SL3中已经没有WateredTextBox,新的控件为DataPickerTextBox

 

 截图如下:

 

 [代码] 代码下载

posted @ 2009-12-12 22:09 rapid 阅读(162) 评论(1) 编辑

不少朋友买了Vista笔记本后,都纷纷改装运行更流畅的Windows 7,遗憾的是,由于内核机制的问题,使得32位版Windows 7无法支持4GB内存,此外,不少笔记本由于BIOS不完善,即便是安装64位版Windows 7,同样无法支持4GB内存,那么,如何让Windows 7笔记本支持4GB内存呢?


让32版Win7支持4GB内存


笔者最近把一台联想笔记本电脑内存升级到了4GB,并安装了32位版本的Windows7系统,可系统却只能认出3.25GB内存容量。其实,利用ReadyFor4GB软件(下载地址:http://sy.mydown.com/31/soft/200906/32_vistawin7buding.zip),就可以让32位版本的Windows7支持超过 4GB 物理内存。执行解压目录下的ReadyFor4GB.exe文件,在软件界面点击“应用”按钮,这样即可破解Windows PAE 内核文件,从而绕过 内核API函数的4GB内存许可限制。

  鼠标右键单击解压目录下的AddBootMenu.cmd文件,选择“以管理员身份运行”,之后根据操作提示添加系统启动项即可,重新启动Windows7系统,当出现开机菜单时,选择 “Windows 7 x86 [ 128GB with ntkr128g.exe ]”登录,就可以完整使用所有的物理内存了,系统也会自动识别4GB内存。之后在系统高级设置中,将“Windows 7 x86 [ 128GB with ntkr128g.exe ]"设置为默认启动项即可。

 

升级BIOS支持4GB内存

 

  笔者同学购买了一台华硕F8VA笔记本,前不久将内存增加到4GB内,并装了64位版本的Windows7系统,可系统却只能识别3GB内存容量,白白浪费了1GB内存资源。按常理来说,64位版本的Windows7最大可支持192GB内存,为何将4GB内存识别为3GB呢?其实,只要升级到209版BIOS就可修复4GB内存无法识别的问题。

 


  下载209版BIOS程序后,同时下载BIOS升级工具,首先制作一个启动闪存,并将BIOS程序和BIOS升级工具拷贝到闪存里,重启系统后,等出现ASUS标志时按F2键进入BIOS设置界面,切换到启动顺序设置闪存引导开机,保存退出后使用闪存引导登录到DOS模式,直接执行AFLASH2.exe命令,然后根据提示升级BIOS,升级成功后重新启动笔记本,再次进入BIOS设置界面初始化参数,之后系统就会识别4GB内存了。

【本文来自】:小孩电脑技术论坛
原文地址-http://www.xhpcnet.cn/bbs/thread-10717-1-1.html

posted @ 2009-09-29 14:20 rapid 阅读(1872) 评论(1) 编辑
摘要: 本来只是回复《最郁闷的一次面试经历》,没想到越写越多再看看他的回复已经很长了,索性另起一篇,也谈谈自己对面试的一些经验看法先回顾下前一篇文章,如果一些没有看到的人,可以大概了解下其次,我们在讨论别人的事,总得把“事”先讲讲吧文章里面说,去面试了一家公司,面试的是.net而面试官只是问了问javascript的问题,就得出此人很一般的结论然后带到总裁(和面试官事父子俩)那,老...阅读全文
posted @ 2009-09-09 18:11 rapid 阅读(3080) 评论(19) 编辑
摘要: 《WF本质论》中的第一章例子using System;using System.Collections.Generic;using System.Threading;namespace OpenSesame{ public delegate void BookmarkLocation(Bookmark resumed); [Serializable] public class Bookmark {...阅读全文
posted @ 2009-08-11 23:15 rapid 阅读(116) 评论(1) 编辑
摘要: 使用WF 中的SqlTrackingService 跟踪服务,我们可以记录有关工作流及其关联活动的跟踪信息到Sql Server数据库库中。SqlTrackingQuery 类提供对包含在跟踪数据库中的数据的高级别访问。但是,我们也可以直接查询 SQL 跟踪服务数据库视图。我们使用WF提供的脚本建立好的Sql数据库主要有21张表,20个视图和59个存储过程,下面就说一些比较重要的。1.跟踪数据库的...阅读全文
posted @ 2009-08-09 19:30 rapid 阅读(233) 评论(1) 编辑
摘要: 技巧:使用User Control做HTML生成2007-12-30 23:06 by Jeffrey Zhao, 13272 visits, 网摘, 编辑   User Control大家肯定不会陌生,在使用ASP.NET的过程中,除了aspx页面,最常见的就莫过于ascx了。ascx是一个有独立逻辑的组件,提供了强大的复用特性,合理使用,能够大大提高开发效率。通过User Control直接生...阅读全文
posted @ 2009-08-03 19:25 rapid 阅读(155) 评论(0) 编辑
摘要: HttpModule—— 一点一点学ASP.NET文野:2006年8月9日星期三上一篇:一点一点学ASP.NET之基础概念——HTTP运行期与页面执行模型 HttpModule是如何工作的当一个HTTP请求到达HttpModule时,整个ASP.NET Framework系统还并没有对这个HTTP请求做任何处理,也就是说此时对于HTTP请求来讲,Ht...阅读全文
posted @ 2009-08-03 18:26 rapid 阅读(51) 评论(0) 编辑