Smobiler上海石磨_.NET移动开发平台

标题: DEMO 中的一段代码执行不正常 [打印本页]

作者: Csharp    时间: 2016-4-19 22:02
标题: DEMO 中的一段代码执行不正常
    private void btnUpUserImg_Click(object sender, EventArgs e)
    {
        try
        {
            this.Camera1.GetPhoto((object sender1, BinaryData data) =>
            {
                if (string.IsNullOrEmpty(data.ErrorInfo))
                {
                    string path = AppDomain.CurrentDomain.BaseDirectory + "\\Icon\\";
                    if (System.IO.Directory.Exists(path) == false)
                    {
                        System.IO.Directory.CreateDirectory(path);
                    }
                    using (System.IO.FileStream stream = System.IO.File.Create(path + data.ResourceID, data.Length))
                    {
                        stream.Write(data.Data, 0, data.Length);
                    }
                    btnUpUserImg.ResourceID = data.ResourceID;
                }
            });
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }



1.  选择从相机选择图片,APP直接关闭

2. 选择从相册选择图片,图片正常上传到服务器,但是用户头像( btnUpUserImg)没正常显示。


作者: Lincy.Lin    时间: 2016-4-20 11:22
感谢您的反馈,您试一下最新版本Designer和客户端http://www.smobiler.com/downloadpc.aspx
最新Demo地址https://github.com/comsmobiler/demo-coms


作者: Csharp    时间: 2016-4-21 00:58
开始用新版本了。




欢迎光临 Smobiler上海石磨_.NET移动开发平台 (https://www.smobiler.cn/) Powered by Discuz! X3.2