資源簡介
該文件是“六足仿生機器人”的全套資料,包含論文、PPT、PCB、代碼、路由固件等大量資料
代碼片段和文件信息
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?WifiVideo
{
????public?partial?class?Config?:?Form
????{
????????public?Config()
????????{
????????????InitializeComponent();
????????}
????????public?string?FileName;?//INI文件名
????????//聲明讀寫INI文件的API函數
????????[DllImport(“kernel32“)]
????????private?static?extern?bool?WritePrivateProfileString(string?section?string?key?string?val?string?filePath);
????????[DllImport(“kernel32“)]
????????private?static?extern?int?GetPrivateProfileString(string?section?string?key?string?def?byte[]?retVal?int?size?string?filePath);
????????private?void?Config_Load(object?sender?EventArgs?e)
????????{
????????????GetIni();
????????}
????????private?void?button1_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_textLightsOn“?this.textLightsOn.Text);
????????????WriteIni(“ControlCommand“?“CMD_textLightsOff“?this.textLightsOff.Text);
????????????MessageBox.Show(“配置成功!請重啟程序以使配置生效。“?“配置信息“?MessageBoxButtons.OK?MessageBoxIcon.Information);?
????????????this.Close();
????????}
????????//寫INI文件
????????public?void?WriteIni(string?Section?string?Ident?string?Value)
????????{
????????????if?(!WritePrivateProfileString(Section?Ident?Value?FileName))
????????????{
????????????????throw?(new?ApplicationException(“寫入配置文件出錯“));
????????????}
??????????
????????}
????????//讀取INI文件指定
????????public?string?ReadIni(string?Section?string?Ident?string?Default)
????????{
????????????Byte[]?Buffer?=?new?Byte[65535];
????????????int?bufLen?=?GetPrivateProfileString(Section?Ident?Default?Buffer?Buffer.GetUpperBound(0)?FileName);
????????????//必須設定0(系統默認的代碼頁)的編碼方式,否則無法支持中文
????????????string?s?=?Encoding.GetEncoding(0).GetString(Buffer);
????????????s?=?s.Substring(0?bufLen);
????????????return?s.Trim();
????????}
????????private?void?GetIni()
????????{
????????????FileName?=?Application.StartupPath?+?“\\Config.ini“;
????????????this.textBoxVideo.Text?=?ReadIni(“VideoUrl“
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-01-14?17:20??六足仿生機器人\
?????目錄???????????0??2018-06-23?16:31??六足仿生機器人\WIFIROBOT\
?????目錄???????????0??2018-06-23?16:31??六足仿生機器人\WIFIROBOT\WifRobot\
?????目錄???????????0??2018-06-23?16:31??六足仿生機器人\WIFIROBOT\WifRobot\obj\
?????目錄???????????0??2018-06-23?16:31??六足仿生機器人\WIFIROBOT\WifRobot\obj\x86\
?????目錄???????????0??2014-03-20?21:55??六足仿生機器人\WIFIROBOT\WifRobot\obj\x86\Debug\
?????目錄???????????0??2018-06-23?16:31??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\
?????文件?????????866??2011-09-28?22:12??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot.sln
?????文件???????27648??2012-05-24?07:35??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot.suo
?????文件???????54784??2013-08-05?15:24??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot.v11.suo
?????目錄???????????0??2018-06-23?16:31??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\bin\
?????目錄???????????0??2018-06-23?16:31??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\bin\Debug\
?????文件??????????86??2011-10-05?22:28??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\bin\Debugconfig.ini
?????文件?????????303??2012-02-22?11:38??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\bin\Debug\Config.ini
?????文件???????11600??2011-09-28?22:04??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\bin\Debug\WifiVideo.vshost.exe
?????文件?????????490??2010-03-17?22:39??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\bin\Debug\WifiVideo.vshost.exe.manifest
?????文件??????533504??2013-08-05?15:02??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\bin\Debug\WifRobot.exe
?????文件???????46592??2013-08-05?15:02??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\bin\Debug\WifRobot.pdb
?????文件???????22984??2013-08-05?15:03??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\bin\Debug\WifRobot.vshost.exe
?????文件?????????490??2012-06-06?02:06??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\bin\Debug\WifRobot.vshost.exe.manifest
?????目錄???????????0??2014-03-20?21:55??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\bin\Release\
?????文件????????4353??2012-02-22?11:34??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\Config.cs
?????文件???????17265??2012-02-22?11:34??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\Config.Designer.cs
?????文件????????5817??2012-02-22?11:34??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\Config.resx
?????文件????????8562??2012-02-22?11:40??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\Form1.cs
?????文件???????12185??2012-02-22?11:37??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\Form1.Designer.cs
?????文件??????108159??2012-02-22?11:37??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\Form1.resx
?????目錄???????????0??2018-06-23?16:31??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\obj\
?????目錄???????????0??2018-06-23?16:31??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\obj\x86\
?????目錄???????????0??2018-06-23?16:31??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\obj\x86\Debug\
?????文件?????????219??2012-01-22?14:34??六足仿生機器人\WIFIROBOT\WifRobot\WifRobot\obj\x86\Debug\Config.ini
............此處省略317個文件信息
評論
共有 條評論