★★★本博客欢迎转载,但请注明版权、原文链接,谢谢。
Memento..
My stories in my way..
posts - 44,comments - 656,views - 29万

今年的MIX09大会真的一天比一天振奋人心,ASP.NET MVC 1.0,Silverlight 3.0, IE 8等核武器级的微软神物纷纷发布。当然,本博客的主要任务是介绍Azure,其他的东东就让别人介绍去吧!

Windows Azure在MIX09上迎来了它的第3个CTP版本——March 2009 CTP,这个版本的更新非常之重要!先列举流牛木马认为其最重要的更新:

  1. 支持部署Full Trust的应用程序!甚至你还可以类似"%RoleRoot%”的Native Code、你可以访问进程、访问注册表!
  2. 支持FastCGI应用程序。这对于Azure的竞争对手Google AppEngine来说绝对是大规模杀伤性武器级的消息。FastCGI为何物?(请自行参考http://www.fastcgi.com)支持FastCGI,意味着Windows Azure上支持PHP、Python、Ruby等各种流行的web开发语言!
  3. URL Rewrite。这个版本的Azure提供了非常方便的URL Rewrite模块,只需要在web.config里稍做配置就可以了。
  4. 支持本地代码调试。 以前的Windows Azure不支持本地代码调试,这算是一个缺陷吧,现在弥补了。

 

在Windows Azure上跑PHP的效果图:

image

 

一段PHP操作Windows Azure Table Storage的示例代码:

复制代码
function fetch($pkey) {
    
$date = gmdate('D, d M Y H:i:s \G\M\T');
    
$stringtosign = "GET\n\n\n$date\n/tweval/TagRatingTable()";
    
$signature = 'SharedKey tweval:'.base64_encode(
        hash_hmac(
'sha256', $stringtosign, base64_decode($key),true));
    
$session = curl_init('http://tweval.table.core.windows.net/TagRatingTable()'
        
.'?$filter=PartitionKey%20eq%20\'' . urlencode($pkey) . '\'');
    curl_setopt(
$session, CURLOPT_HTTPHEADER, array("x-ms-date:$date", "Authorization:$signature"));
    curl_setopt(
$session, CURLOPT_RETURNTRANSFER, true);
    
$response = curl_exec($session);
    curl_close(
$session);
    
$result = array();
    
foreach(simplexml_load_string($response)->entry as $entry) {
        
$properties =
            
$entry>content>children('http://schemas.microsoft.com/ado/2007/08/dataservices/metadata')
            
>properties>children('http://schemas.microsoft.com/ado/2007/08/dataservices');
        
$result[] = new Rating((string)($properties>Username), (int)($properties>StatusId),
            (
float)($properties>Score), (string)($properties>Tweet), new DateTime($properties>CreatedAt));
    }
    
usort($result, 'cmp');
    
return $result;
}
复制代码

 

如果你是Python爱好者,你会惊喜地发现使用Python来操作Windows Azure的服务也是那么容易:

http://github.com/sriramk/winazurestorage/tree/master

下载Windows Azure Tools for Visual Studio and SDK(合二为一的安装文件): http://go.microsoft.com/fwlink/?LinkId=128752

posted on   流牛木马  阅读(2223)  评论(9编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· 展开说说关于C#中ORM框架的用法!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
< 2009年3月 >
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 1 2 3 4
5 6 7 8 9 10 11

点击右上角即可分享
微信分享提示