小编Tim*_*sor的帖子

什么是+ =(o,arg)=>实际上实现了什么?

很抱歉要问所有人,但我是一个老手Vb.net的家伙谁转移到c#.我有以下代码片段似乎在触发postAsync方法(在本例中)时激活.我只是不明白代码在做什么(如下): -

app.PostCompleted +=
    (o, args) =>
    {
        if (args.Error == null)
        {
            MessageBox.Show("Picture posted to wall successfully.");
        }
        else
        {
            MessageBox.Show(args.Error.Message);
        }
    };
Run Code Online (Sandbox Code Playgroud)

如果有人能解释+ =(o,args)=>实际上是什么,我会非常感激....

提前谢谢了.蒂姆

c#

15
推荐指数
3
解决办法
1085
查看次数

访问HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData

谁能告诉我为什么我无法访问注册表项"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData"

如果我查询GetSubKeysNames"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer"它只返回一个值的存在"Secure"---->在哪里是所有其他子项?

谢谢.

c# registry registrykey

6
推荐指数
1
解决办法
4290
查看次数

将BitmapSource转换为Windows Phone流

我有一个类要求Stream从手机摄像头旋转图像.我遇到的问题是,当从隔离存储器加载图片时(即在用户之前保存图片之后),它被加载到BitmapSource中.

如果可能,我想将位图源"提取"回流中?有谁知道它是否使用Silverlight的WP7?

谢谢

c# windows-phone-7

3
推荐指数
1
解决办法
6074
查看次数

委托中的异常处理

我有以下代码,它在尝试抛出错误时给出了" 用户代码未处理的异常 ":

private static void _msgQ_RecieveCompleted(object sender, ReceiveCompletedEventArgs e)
{
    try
    {
        //queue that have received a message
        MessageQueue _mq = (MessageQueue)sender;

        //get the message off the queue
        Message _mqmsg = _mq.EndReceive(e.AsyncResult);
        throw new Exception("This is a test exception by Tim");

        //set the values back into a formatted struct 
        //now process your SQL....
        Azure_SQL _azuresql = new Azure_SQL();
        _azuresql.writeMessageToStorage((_TwitterStreamFeed)_mqmsg.Body);

        //refresh queue just in case any changes occurred (optional)
        _mq.Refresh();

        //tell MessageQueue to receive next message when it arrives
        _mq.BeginReceive(); …
Run Code Online (Sandbox Code Playgroud)

c# delegates msmq exception-handling try-catch

1
推荐指数
1
解决办法
8146
查看次数