入门或理论研究系列文章

智能手机

手机词汇

研发手机基本流程

我理解的Windows moblie

J2ME,CompactFramework,c++,我该如何取舍

Windows Mobile Jump Start Guide

从0开始Windows Mobile 开发

3G 手机流媒体应用,看上去很美

基于rtsp的手机视频点播实现和研究

手机流媒体

UI开发 

WINCE应用的UI实现方案 —— 上篇:几种UI实现方案比较

Windows Mobile 和 Wince 下的 WTL(Windows Template Library) 界面开发

Mobile个人开发(绘制背景图片)

怎样在Windows Mobile上设计一个美观的用户界面程序(Win32)

EVC中的图片背景透明处理

Windows Mobile载入位图的方法

[翻译]Windows Mobile应用程序设计指导-软键和菜单

创建Windows Mobile上兼容性好的UI 程序

windows mobile 5.0 下创建菜单

在Visual Studio 2005下创建WM for Smartphone/Standard 软键菜单的问题

AP的全屏与非全屏的切换

如何创建在 PocketPC 全屏幕应用程序(转)

关于wince中的全屏显示

用本地代码实现屏幕方向自适应的Windows Mobile程序

mobile手机上窗体最小化后置icon在消息栏的处理.

 

GPRS开发系列 

GPRS入门知识

GPRS开发系列文章之入门篇(转)

GPRS开发系列文章之进阶篇

GPRS开发系列文章之实战篇(转)

GPRS技术在配电监控系统中的应用[转载]

WM5.0下连接移动GPRS

Windows Mobile中如何建立GPRS连接以便Socket能正常通信

PDA/PPC下如何获取GPRS的网络流量(ZT)

windows ce gprs 拨号程序(转)

C# wm6通过udp协议和pc通讯

 

.NET Compact Framework

.NET Compact Framework 多线程下的等待事件

.NET Compact Framework 多线程环境下的UI异步刷新

定时关闭窗口 For Windows Mobile SP/PPC

Microsoft .NET CF 与非托管代码交互注意事项

.NET Compact Framework 下的3G应用

在.NET Compact Framework调用PPC设备的震动功能

.Net Compact Framework 基础篇(1)

.Net Compact Framework 基础篇(4)

.Net Compact Framework 高级篇(1)

列车时刻表 开发回顾 (一):后台线程更新前端界面

 

开发环境 + 模拟器使用 + 疑难杂症 

VS无法调试智能设备程序的解决方案

在Windows Mobile Emulator建立网络连接

配置PPC模拟器网络环境,调试TCP/UDP套接字程序

Windows Mobile 2003 SE 模拟器上网设置

Ring Tone Manager on Windows Mobile

Windows Mobile Device Emulator In-Depth--(1)

Windows Mobile Device Emulator In-Depth--(2)

在Visual Studio 2005里,用ActiveSync来同步模拟器(Windows Mobile 5.0 For Smartphone)

也谈EVC工程移植

手机音频流媒体应用与优化指南

ANSI码和UNICODE码转化

WCHAT、TCHAT、CString和char*的转换(WM5.0)

WinCe和Windows Mobile下的字符串转换

【转】使用 AYGShell 实现 Windows CE .NET 和 Pocket PC 2002 外壳兼容性

[转]从AP中获取电池和电源信息变更通知的方法

中文问题-Mobile-UrlEncode

如何判断当前WM系统是否是Smartphone?

利用tmail.exe 命令参数来发送邮件

 

其它资源 

Wince 

Windows Mobile

Windows Mobile 开发工具和资源

移动开发索引贴  

平时收获,供需及取(PPC)

Mobile开发之路_之小总结

WINCE 开发资料汇集

iPhone开发知识介绍

symbian中的新手问题整理(均有解答)

Mobile.ConnectionMonitor

Windows Mobile-Bookmarks

Windows Mobile 系列文章索引---不断整理中(2009-04-04)

H.264系列视频编解码器代码下载(Windows和Windows CE/Windows Mobile版本)

手机音视频流媒体开发一些有用资料

水煮TCPMP

WinCE开发流媒体播放器--MPEG4

Windows Mobile 开发资源

Windows Mobile 常用键值(VK)对应表及系统文件夹简单介绍

 

 

具体应用开发文章 

WM性能优化的一些经验

Windows Mobile SP/PPC 中 Menu Bar 使用完美方案

Windows Mobile平台上重写Back健的行为

也谈Windows Mobile中打开/关闭WIFI

VC通用控件自适应屏幕类

在非纯色背景上,叠加背景透明的BUTTON和STATIC_TEXT控件

在Windows mobile 5.0下操作INI文件

WinMoblie 利用EVC读写INI,XML配置文件

windows mobile 5.0 下创建菜单

Windows Mobile 发送短信的问题

3G应用---windows mobile和symbian平台下rtsp流媒体播放器

[流媒体]实例解析MMS流媒体协议,下载LiveMediaVideo[1][修正版,增加了带宽测试包]

[J2ME]手机看交通监视器实时录像 实现说明

[J2ME]手机流媒体之实作[附源码][与RTSP/MMS协议无关]

【蛙蛙推荐】手机通讯录实现

 

posted @ 2009-06-14 09:37 winkingzhang| 编辑
     摘要: 刚才开到智者千虑发的【WPF】在Style中设置ToolTip的问题的博文,虽然最终给了一个暂时解决问题的方案,但是没有分析和解释其中的问题,正与他所说:但至于为什么不能直接在Setter.Value中放置TextBlock还是一个未解之谜。 趁着中午间隙,跟踪了一下,这里我将带给你完整的分析。   阅读全文
posted @ 2009-01-15 16:49 winkingzhang 阅读(956) | 评论 (2)编辑
     摘要: 昨晚看到南柯之石的WPF BUG之四:点击RadioButton的空白没有反应,就做了简单的验证,之后发表了一些分析和看法,但是那个分析不够准确和充分,导致了对别人的想法一些误导。在此表示歉意。这里我会从头做分析。  阅读全文
posted @ 2009-01-13 13:54 winkingzhang 阅读(1144) | 评论 (2)编辑
     摘要: Xaml的出现使得Win下非常有效的MVC变得复杂了很多很多,而WPF的发布使得Web程序和Win程序的鸿沟渐渐填平,对于模式的思考也渐渐浮出来:是使用复杂化的MVC,还是微软提出的MVP,抑或其他的模式。  阅读全文
posted @ 2008-12-01 11:59 winkingzhang 阅读(142) | 评论 (2)编辑

http://blogs.msdn.com/helloworld/archive/2008/10/31/how-to-get-iis-web-sites-information-programmatically.aspx

How to Get IIS Web Sites Information Programmatically

I needed to get the location of IIS log files on my servers, after doing a quick investigation, I am quite amazed on how much information are exposed via managed code.

This snippet will return the name of the sites and the location of the log files.

foreach (DirectoryEntry Site in new DirectoryEntry("IIS://" + System.Environment.MachineName + "/w3svc").Children)
if (String.Compare(Site.SchemaClassName, "IIsWebServer", StringComparison.OrdinalIgnoreCase) == 0)
Console.WriteLine(Site.Properties["ServerComment"].Value.ToString() + " == " + Site.Properties["LogFileDirectory"].Value.ToString());

To get more information about what fields and method you can access, please refer to this MSDN doc: http://msdn.microsoft.com/en-us/library/ms524487.aspx.

Just remember, in Vista/Windows Server 2008, you will need to run that code with elevated privilege.

 

posted @ 2008-10-31 15:55 winkingzhang 阅读(23) | 评论 (0)编辑
     摘要: 今天遇到JIT老是弹出的烦人问题,在MSDN上找到了关闭的说明。  阅读全文
posted @ 2008-10-10 11:21 winkingzhang 阅读(175) | 评论 (0)编辑

Yesterday I was having a conversation with Anil Ruia who happens to be the ARR (Application Request Routing) developer and based on customer feedback we discussed the idea of using ARR in the context of Remote Management in IIS which solves a question that several people asked me before and thought it would be fun to try it out.

Basically the question that I got asked was "Can I have a single entry-point exposed for Remote Management?", or in other words "Can I provide users with remote administration giving them a single server name like management.myhostingcompany.com, instead of having to give them the specific machine name where their site lives?". So far the answer to these questions was "not easily", however with the use of ARR and URL Rewriter we will see how easy it is to achieve this.

The only thing you need for this to work is install the new URL Rewrite and ARR Module both available here http://blogs.iis.net/bills/archive/2008/07/09/new-iis7-releases-url-rewrite-application-routing-and-load-balancing-and-powershell-cmd-lets.aspx.

Background

The Web Management Service (WMSvc) is the service that enables remote administration for IIS 7.0 Manager, providing an HTTPS end-point that exposes functionality similar to Web Services to manage the Web Server (IIS) remotely. This service uses HTTPS for its communication and exposes several configuration options that support giving access to Non-Windows Users (What we call IIS Manager Users), provide a list of IP Restrictions, support only local connections and many more that can be managed using the Management Service feature inside IIS Manager.

To enable remote administration typically you need to: 1) Configure a valid Certificate for SSL, 2) Allow Remote Connections and 3) Start the WMSvc Service, all of which can be performed in IIS Manager. Once you have successfully enabled the remote service you should be able to go to a different machine and be able to connect remotely.

Note: If you are using Windows Vista, Windows XP, or Windows 2003 to connect to a Windows Server 2008 you need to download and install the client to do this: http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1626

However, one of the drawbacks is that in order to be able to connect to a Web Site, the end-user needs to know the machine name, as well as the name of the Web Site they will be connecting to, which sometimes it would be better to be dynamic. The following image shows the information required to enter when connecting to a Web Site. Note that if connecting to an application you will also need to enter the name of the application.

ConnectingToSite

However, this can potentially reduce the flexibility for deployment options, since now your customers have specific knowledge of the physical machine and will limit the flexibility of moving the site to different machines or even changing the name of the site where it is being hosted.

ARR and URL Rewrite to the rescue.

ARR has several very interesting capabilities that are really useful for this scenario. First, we can configure it to act as a proxy and basically forward the requests to another server where they actually get processed. This is the simplest configuration option and what it allows you is to have something similar to the next image:

WMSvcRouting

To set up this configuration where a front-end management server forwards the IIS Remote Management requests to another server running WMSVC you have to:

  1. Install ARR and URL Rewrite in the Server that is intended to be used as the front-end for management requests. Lets call this ServerA.
  2. Create a new Web Site.
    1. Navigate to IIS Manager->Site
    2. Click Add Web Site.
    3. In the dialog set: Site name:ManagementSite, Binding: https, port: 8172 and choose a valid SSL certificate, specify a phisical path. Click OK
  3. Configure URL Rewrite to Route requests to the IIS Management Service running in the other computer.
    1. Navigate to IIS Manager->Sites->Management Site->URL Rewrite Module
    2. Click Add Rule
    3. Set: Name: RouteWMSvc, Pattern:.*, Rewrite URL:https://<RemoteServer>:8172/{R:0}, Stop Processing rules: Checked.
    4. This should generate a web.config with similar content (note that my backend, ie the RemoteServer in my case is carlosag2-iis below):

      <configuration>
         
      <system.webServer>
             
      <rewrite>
                 
      <rules>
                     
      <rule name="RouteWMSvc" stopProcessing="true">
                         
      <match url=".*" />
                          <
      action type="Rewrite" url="https://carlosag2-iis:8172/{R:0}" />
                      </
      rule>
                 
      </rules>
             
      </rewrite>
         
      </system.webServer>
      </configuration>

  4. Now you can run IIS Manager in any client machine, specify the ServerA as the machine name and specify any web site in the remote RemoteServer, the result will be that all requests will be forwarded to the WMSvc running in the remote server.

Now, that is interesting and the scenario it allows you to do is potentially have WMSvc IP Request Filtering in the RemoteServer and only allow calls from the Management Server where you can do further configuration. Note that this also means that you can have a single public SSL Certificate in the management server and use privately issued certificates (or potentially even self-signed certificates in the remoteserver since you can control installing the certificate into the management server). It also means that the customers no longer use the physical name of the RemoteServer machine but instead connect to the Management Server allowing you to completely move them to another machine and not have to update your clients.

Troubleshooting: If you are having troubles testing this, the best thing to do is enable Failed Request Tracing in the ManagementSite, which will tell you exactly what is going on. For example you will get entries like:

Warning: ModuleName="ApplicationRequestRouting", Notification="EXECUTE_REQUEST_HANDLER", HttpStatus="502", HttpReason="Bad Gateway", HttpSubStatus="3", ErrorCode="2147954575", ConfigExceptionInfo=""

If you lookup the ErrorCode, it is actually: ERROR_WINHTTP_SECURE_FAILURE, this means that you have most likely issues with the certificate. In my case, just to test this what I did is generate a self-signed certificate in the RemoteServer with the name of the machine (carlosag2-iis) and then I installed that certificate using the MMC certificates snap-in in the management server into the Trusted Root Certification Authority. Disclaimer Warning!! this is something you should only do for testing purposes or if you know what you are doing.

More Advanced Stuff... Dynamically choosing the machine

Now, trying to push the capabilities of this I decided to solve another requests that we've heard which is closely related "Can I have a single management server and dynamically route the requests to the machine where a particular site lives?"

The following picture represents this, where the Management Server dynamically resolves the server that it should talk to using the URL Rewrite Maps functionality.

WMSvcRoutingMultiple

Turns out this is really simple using URL Rewrite, basically you can write a Rewrite Rule that matches the Site name that is included as part of the Query String and use the Rewrite Maps support for figuring out the machine where this site lives. The following shows such a rule:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
 
<system.webServer>
   
<rewrite>
     
<rules>
       
<rule name="RouteWMSvc" stopProcessing="true">
         
<match url=".*" />
          <
conditions>
           
<add input="{QUERY_STRING}" pattern="Site=([^&amp;]+)" />
          </
conditions>
         
<action type="Rewrite" url="https://{ServersTable:{C:1}}:8172/{R:0}" appendQueryString="true" />
        </
rule>
     
</rules>
     
<rewriteMaps>
       
<rewriteMap name="ServersTable">
         
<add key="CarlosAgWebSite" value="carlosag2-iis" />
          <
add key="SomeOtherUserSite" value="carlosag1-iis" />
          <
add key="SomeOtherUserSite2" value="carlosag3-iis" />
        </
rewriteMap>
     
</rewriteMaps>
   
</rewrite>
 
</system.webServer>
</configuration>

Basically, URL Rewrite matches every request and uses the condition entry to parse the Query String and find the Site name within it. With it, it and using the Map ServersTable to resolve the machine name based on the Site name it rewrites the request to the machine where its currently located. This makes it basically route "https://localhost:8172/Service.axd?...&Site=CarlosAgWebSite into https://carlosag2-iis:8172/Service.axd?...&Site=CarlosAgWebSite. The end result is that can dynamically at any time just update this table and make ARR route the requests to the right machine giving you complete flexibility on the deployment of sites.

One thing to note is that URL Rewrite is one of the ways you can make the ARR scenario work, however, you could also write your own module that uses any dynamic behavior such as going to a database or a provisioning system or anything else and rewrite the URL programmatically in a way that ARR will understand it and do the routing automatically.

Also, worth to mention that ARR has way more features than just this, making it possible to load-balance requests and many more interesting stuff that I will try to get back in a future post.

With all this you can imagine several benefits, such as single public end-point for remote management of multiple servers, only one valid certificate is needed facing public machines, you can relocate sites at your own will since customers will never really know the real machine name where their site lives, you can use a similar technique to rewrite even the Site Name and give them some friendly name such as their user name or whatever.

Acknowledgements: I want to thank Anil Ruia and Daniel Vasquez Lopez who helped figuring out a few issues during this blog and Ruslan Yakushev and Won Yoo for reviewing its technical accuracy.

posted @ 2008-08-22 19:01 winkingzhang 阅读(185) | 评论 (0)编辑
     摘要: Reference Resources for MOSS and WSS  阅读全文
posted @ 2008-07-08 11:49 winkingzhang 阅读(52) | 评论 (0)编辑
     摘要: FileSystemWatcher事件多次触发的解决方法   阅读全文
posted @ 2008-07-04 10:05 winkingzhang 阅读(92) | 评论 (0)编辑
     摘要: Have you ever wondered about all the stages that an ASP.NET request goes through? Ever wonder why it is such a performance hit to have a wildcard mapping to map all extensions on your web server to ASP.NET? This information corresponds to IIS 5.0 and 6.0.   阅读全文
posted @ 2008-05-28 14:45 winkingzhang 阅读(61) | 评论 (0)编辑