• 大小: 1.51MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-31
  • 语言: C#
  • 标签: wifi  视频  上位机  

资源简介

wifi视频小车的上位机 C#源码PC上位机

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WifiCar
{
    public partial class Config : Form
    {
        public Config()
        {
            InitializeComponent();
        }
        public string FileName;
        [DllImport(“kernel32“)]//引入kerner32.dll这个动态链接库,里面包括了很多WindowsAPI函数,使用里面的函数就要这样引入
        private static extern bool WritePrivateProfileString
            (string section string key string val string filePath);

        //是用来写入ini文件的一个win32 API
        //WritePrivateProfileString就是属于kerner32.dll动态库的一个函数
        //section(节名),key(项名),val(项的值),byte[](retVal缓冲区),
        //size(装到缓冲区的最大字节数),filePath(ini文件的完整路径)
        [DllImport(“kernel32“)]
        //读取INI文件(字符)
        private static extern int GetPrivateProfileString
            (string section string key string def byte[] retVal int size string filePath);
        //section(节名),key(项名),val(项的值),byte[](retVal缓冲区),
        //size(装到缓冲区的最大字节数),filePath(ini文件的完整路径)
        private void Config_Load_1(object sender EventArgs e)
        {
            GetIni();
        }
        private void SaveButton_Click(object sender EventArgs e)
        {
            WriteIni(“VideoUrl“ “videourl“ this.textBoxVideo.Text);
            WriteIni(“ControlUrl“ “controlUrl“ this.textControlURL.Text);
            WriteIni(“ControlPort“ “controlPort“ this.textBoxControlPort.Text);
            WriteIni(“ControlCommand“ “CMD_Forward“ this.txtForward.Text);
            WriteIni(“ControlCommand“ “CMD_Backward“ this.txtBackward.Text);
            WriteIni(“ControlCommand“ “CMD_TurnLeft“ this.txtLeft.Text);
            WriteIni(“ControlCommand“ “CMD_TurnRight“ this.txtRight.Text);
            WriteIni(“ControlCommand“ “CMD_Stop“ this.txtStop.Text);
            WriteIni(“ControlCommand“ “CMD_EngineUp“ this.txtEngineUp.Text);
            WriteIni(“ControlCommand“ “CMD_EngineDown“ this.txtEngineDown.Text);
            WriteIni(“ControlCommand“ “CMD_EngineLeft“ this.txtEngineLeft.Text);
            WriteIni(“ControlCommand“ “CMD_EngineRight“ this.txtEngineRight.Text);
            WriteIni(“ControlCommand“ “CMD_OnLight“ this.txtOnLight.Text);
            WriteIni(“ControlCommand“ “CMD_OffLight“ this.txtOffLight.Text);
            MessageBox.Show(“配置成功!请重启程序以使配置生效。“ 
                “配置信息“ MessageBoxButtons.OK MessageBoxIcon.Information);
            this.Close();

        }
        public void WriteIni(string Section string Ident string Value)
        {
            if (!WritePrivateProfileString(Section Ident Value FileName))
            {

                throw (new ApplicationException(“写入配置文件出错“));
            }

        }

        public string ReadIni(string Section string Ident string Default) //读取文件函数
        {
  

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        331  2013-11-06 09:58  WifiCar\WifiCar\bin\Debug\Config.ini

     文件     165376  2013-11-03 22:18  WifiCar\WifiCar\bin\Debug\Interop.SpeechLib.dll

     文件     586240  2013-11-07 17:14  WifiCar\WifiCar\bin\Debug\WifiCar.exe

     文件      54784  2013-11-07 17:14  WifiCar\WifiCar\bin\Debug\WifiCar.pdb

     文件      11600  2013-11-07 17:14  WifiCar\WifiCar\bin\Debug\WifiCar.vshost.exe

     文件         86  2011-10-05 22:29  WifiCar\WifiCar\bin\Debugconfig.ini

     文件        331  2013-11-06 09:58  WifiCar\WifiCar\bin\Release\Config.ini

     文件     585728  2013-11-07 17:14  WifiCar\WifiCar\bin\Release\WifiCar.exe

     文件      52736  2013-11-07 17:14  WifiCar\WifiCar\bin\Release\WifiCar.pdb

     文件      11600  2013-11-07 17:15  WifiCar\WifiCar\bin\Release\WifiCar.vshost.exe

     文件        490  2010-03-17 22:39  WifiCar\WifiCar\bin\Release\WifiCar.vshost.exe.manifest

     文件     432254  2012-03-24 10:23  WifiCar\WifiCar\camera-app.ico

     文件     432254  2012-03-24 10:23  WifiCar\WifiCar\camera.ico

     文件     432254  2012-03-24 10:23  WifiCar\WifiCar\clock-black.ico

     文件       5691  2013-11-06 11:55  WifiCar\WifiCar\Config.cs

     文件      18695  2013-11-06 11:23  WifiCar\WifiCar\Config.Designer.cs

     文件       5817  2013-11-06 11:23  WifiCar\WifiCar\Config.resx

     文件      10892  2013-11-07 17:14  WifiCar\WifiCar\Form1.cs

     文件      15183  2013-11-07 17:14  WifiCar\WifiCar\Form1.Designer.cs

     文件     197970  2013-11-07 17:14  WifiCar\WifiCar\Form1.resx

     文件      76381  2011-12-23 19:09  WifiCar\WifiCar\lanbojini.jpg

     文件      51262  2012-05-05 23:45  WifiCar\WifiCar\logo.ico

     文件      89627  2012-03-30 00:54  WifiCar\WifiCar\logo.png

     文件        200  2013-10-31 22:55  WifiCar\WifiCar\obj\x86\Debug\Config.ini

     文件       8858  2013-11-05 19:18  WifiCar\WifiCar\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6571  2013-11-07 17:14  WifiCar\WifiCar\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        666  2013-11-07 17:14  WifiCar\WifiCar\obj\x86\Debug\GenerateResource.read.1.tlog

     文件       1362  2013-11-07 17:14  WifiCar\WifiCar\obj\x86\Debug\GenerateResource.write.1.tlog

     文件       2935  2013-11-05 19:18  WifiCar\WifiCar\obj\x86\Debug\UserControl1.g.i.cs

     文件        180  2013-11-07 17:13  WifiCar\WifiCar\obj\x86\Debug\WifiCar.Config.resources

............此处省略43个文件信息

评论

共有 条评论