小编Lui*_*pez的帖子

如何在QT中设计具有自定义形状的按钮

我试图在Qt中设计一系列带有箭头形状的自定义按钮,但我找不到方法。我需要类似下图所示的按钮之类的东西,以便管理程序的工作流程并指导用户进行操作。 工作流程指南按钮 图像的文本应为“步骤1”,“步骤2”和“步骤3”。对不起,这个错误。欢迎任何帮助或建议。谢谢你的帮助。

qt qt4 button

4
推荐指数
2
解决办法
5086
查看次数

如何等待直到带有HttpWebRequest的Web请求完成?

我正在执行Web请求以登录我的Web服务,但是我遇到了问题。我需要等到登录完成后才能结束启动登录的方法,因为我需要返回一个表示登录是否正确的布尔值。在以下代码中,我在需要等待“ httpWebRequest.BeginGetResponse(...)”结果的位置添加了注释。

public async Task<bool> login(string user, string passwrd)
{
    mLoginData.setUserName(user);
    mLoginData.setPasswd(passwrd);

    string serviceURL = mBaseURL + "/pwpcloud/service/user/login";

    //build the REST request
    // HTTP web request
    var httpWebRequest = (HttpWebRequest)WebRequest.Create(serviceURL);
    httpWebRequest.ContentType = "application/json";
    httpWebRequest.Method = "POST";

    // Write the request Asynchronously 
    using (var stream = await Task.Factory.FromAsync<Stream>(httpWebRequest.BeginGetRequestStream, httpWebRequest.EndGetRequestStream, null))
    {

        string parameters = "{\"username\":\"" + user + "\",\"password\":\"" + passwrd + "\"}";
        byte[] byteArray = Encoding.UTF8.GetBytes(parameters);

        // Write the bytes to the stream
        await stream.WriteAsync(byteArray, 0, byteArray.Length);
    }
    //httpWebRequest.BeginGetResponse(new AsyncCallback(OnGettingLoginResponse), …
Run Code Online (Sandbox Code Playgroud)

c# rest httpwebrequest httpwebresponse windows-phone-8

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

标签 统计

button ×1

c# ×1

httpwebrequest ×1

httpwebresponse ×1

qt ×1

qt4 ×1

rest ×1

windows-phone-8 ×1