我目前正在学习 C++,想要更改我的桌面壁纸。但是我收到上面这个错误。
#include <string>
#include <iostream>
#include <Windows.h>
using namespace std;
int main() {
LPWSTR test = L"C:\\Users\\user\\Pictures\\minion.png";
int result = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0,
test, SPIF_UPDATEINIFILE);
}
Run Code Online (Sandbox Code Playgroud)
“Const wchar_t*”类型的值不能用于初始化 LPWSTR 类型的实体
有任何想法吗?
谢谢
我正在尝试使用 okhttp 和 Flask 将本地后端和前端连接在一起,但是我收到 java.net.ConnectException: failed to connect to /127.0.0.1 (port 5000) after 10000ms: isConnected failed: ECONNREFUSED (Connection Dockered)例外
现在 API 确实可以正常工作,因为我可以在邮递员中访问它并返回值,这是代码
from flask import request, Flask
import getMovie
import getUser
api = Flask(__name__)
#Movie Endpoints
@api.route('/Movies/GetMovieById', methods=['GET'])
def get_movie_by_id():
id = str(request.args['id'])
return getMovie.getById(id)
@api.route('/Movies/All', methods=['GET'])
def get_all_movies():
return getMovie.getAll()
#User Endpoints
@api.route('/Users/All', methods=['GET'])
def get_all_users():
return getUser.getAll()
@api.route('/Users/GetUserById', methods=['GET'])
def get_user_by_id():
id = str(request.args['id'])
return getUser.getById(id)
if __name__ == '__main__':
api.run()
Run Code Online (Sandbox Code Playgroud)
然后这是 Android 应用程序的主要活动
package com.example.moviebuffs
import …Run Code Online (Sandbox Code Playgroud)