分类 默认分类 下的文章

1.Ubuntu系统真机(我用的版本18.04)

2.Ubuntu改国内源

备份源

cp /etc/apt/sources.list /etc/apt/sources.list.bak

改源

sudo nano /etc/apt/sources.list

中科大源

deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

更新

sudo apt-get update
sudo apt-get upgrade

3.https://github.com/Thore-Krug/Flash-CHIP

2019-10-15 17-08-48屏幕截图.png

2019-10-15 17-09-12屏幕截图.png

2019-10-15 17-08-29屏幕截图.png

刷完之后发现触摸屏方向是左右上下相反

1、在终端内输入:sudo nano /etc/X11/xorg.conf

2、将来以下这句添加到最后

Section "InputClass"
Identifier "calibration"
MatchProduct "1c25000.rtp"
Option "Calibration" "3980 226 3564 343"
Option "SwapAxes" "0"
EndSection

ctrl+X 退出
Y保存
回车确认

3、最后重启

using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.Mvc;

namespace WebApplication1.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class UpLoadController : ControllerBase
    {
        private readonly IHostingEnvironment _hostingEnvironment;

        public UpLoadController(IHostingEnvironment hostingEnvironment)
        {
            _hostingEnvironment = hostingEnvironment;
        }

        [HttpPost]
        public string Post([FromForm] IFormCollection formCollection)
        {
            string result = "";
            string webRootPath = _hostingEnvironment.ContentRootPath;
            string contentRootPath = _hostingEnvironment.ContentRootPath;

            FormFileCollection filelist = (FormFileCollection)formCollection.Files;

            foreach (IFormFile file in filelist)
            {
                String Tpath = "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
                string name = file.FileName;
                string FileName = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                string FilePath = webRootPath + Tpath;

                string type = Path.GetExtension(name);
                DirectoryInfo di = new DirectoryInfo(FilePath);

                if (!di.Exists)
                {
                    di.Create();
                }

                using (FileStream fs = System.IO.File.Create(FilePath + FileName + type))
                {
                    // 复制文件
                    file.CopyTo(fs);
                    // 清空缓冲区数据
                    fs.Flush();
                }
                result = "1";
            }
            return result;
        }
    }
}

Unity中调用

    private IEnumerator UpLoadImg(string filePath)
    {   
        byte[] bs = File.ReadAllBytes(filePath); 
        Log.Debug("bs.Length:" + bs.Length.ToString());  
        WWWForm test = new WWWForm();
        test.AddBinaryData("imgbase.jpg", bs, "imgbase.jpg");
        WWW www = new WWW("http://192.168.2.185/api/upload", test);
        yield return www;
        Log.Debug(www.text);
    }

sudo nano /usr/share/applications/Unity.desktop


[Desktop Entry]
Encoding=UTF-8
Name=Unity
Comment=Unity
Exec=/opt/Unity-2017.4.10f1/Editor/Unity
Icon=/opt/Unity-2017.4.10f1/Editor/Data/Resources/LargeUnityIcon.png
Terminal=false
StartupNotify=true
Type=Application
Categories=Application;Development;

2018-12-06 22-30-31屏幕截图.png