diff --git a/dell_fans_controller/Dell/SysMgt/bmc/DSM_BMU_SOLProxy32.exe b/dell_fans_controller/Dell/SysMgt/bmc/DSM_BMU_SOLProxy32.exe
new file mode 100644
index 0000000..b55d322
Binary files /dev/null and b/dell_fans_controller/Dell/SysMgt/bmc/DSM_BMU_SOLProxy32.exe differ
diff --git a/dell_fans_controller/Dell/SysMgt/bmc/cygcrypto-0.9.8.dll b/dell_fans_controller/Dell/SysMgt/bmc/cygcrypto-0.9.8.dll
new file mode 100644
index 0000000..a9ada96
Binary files /dev/null and b/dell_fans_controller/Dell/SysMgt/bmc/cygcrypto-0.9.8.dll differ
diff --git a/dell_fans_controller/Dell/SysMgt/bmc/cyggcc_s-1.dll b/dell_fans_controller/Dell/SysMgt/bmc/cyggcc_s-1.dll
new file mode 100644
index 0000000..8ac070d
Binary files /dev/null and b/dell_fans_controller/Dell/SysMgt/bmc/cyggcc_s-1.dll differ
diff --git a/dell_fans_controller/Dell/SysMgt/bmc/cygwin1.dll b/dell_fans_controller/Dell/SysMgt/bmc/cygwin1.dll
new file mode 100644
index 0000000..1cd5dd9
Binary files /dev/null and b/dell_fans_controller/Dell/SysMgt/bmc/cygwin1.dll differ
diff --git a/dell_fans_controller/Dell/SysMgt/bmc/cygz.dll b/dell_fans_controller/Dell/SysMgt/bmc/cygz.dll
new file mode 100644
index 0000000..210281a
Binary files /dev/null and b/dell_fans_controller/Dell/SysMgt/bmc/cygz.dll differ
diff --git a/dell_fans_controller/Dell/SysMgt/bmc/dcwipm32.dll b/dell_fans_controller/Dell/SysMgt/bmc/dcwipm32.dll
new file mode 100644
index 0000000..61dde91
Binary files /dev/null and b/dell_fans_controller/Dell/SysMgt/bmc/dcwipm32.dll differ
diff --git a/dell_fans_controller/Dell/SysMgt/bmc/ipmish.exe b/dell_fans_controller/Dell/SysMgt/bmc/ipmish.exe
new file mode 100644
index 0000000..dee92da
Binary files /dev/null and b/dell_fans_controller/Dell/SysMgt/bmc/ipmish.exe differ
diff --git a/dell_fans_controller/Dell/SysMgt/bmc/ipmitool.exe b/dell_fans_controller/Dell/SysMgt/bmc/ipmitool.exe
new file mode 100644
index 0000000..a5b0e1c
Binary files /dev/null and b/dell_fans_controller/Dell/SysMgt/bmc/ipmitool.exe differ
diff --git a/dell_fans_controller/Dell/SysMgt/bmc/readme.txt b/dell_fans_controller/Dell/SysMgt/bmc/readme.txt
new file mode 100644
index 0000000..f65c13c
--- /dev/null
+++ b/dell_fans_controller/Dell/SysMgt/bmc/readme.txt
@@ -0,0 +1,253 @@
+THIRD PARTY LICENSE FILE
+
+Contents:
+
+A) SHA1
+B) OpenSSL
+C) ACE(tm)
+D) LibTomCrypt
+
+
+
+*****************************************************************************
+A) The following software may be included in this product: RFC 3174 - US
+Secure Hash Algorithm 1 (SHA1). Use of any of this software is governed by
+terms of the license below:
+*****************************************************************************
+
+Full Copyright Statement
+
+Copyright (c) The Internet Society (2001). All Rights Reserved.
+
+This document and translations of it may be copied and furnished to others,
+and derivative works that comment on or otherwise explain it or assist in its
+implementation may be prepared, copied, published and distributed, in whole
+or in part, without restriction of any kind, provided that the above
+copyright notice and this paragraph are included on all such copies and
+derivative works. However, this document itself may not be modified in any
+way, such as by removing the copyright notice or references to the Internet
+Society or other Internet organizations, except as needed for the purpose of
+developing Internet standards in which case the procedures for copyrights
+defined in the Internet Standards process must be followed, or as required to
+translate it into languages other than English.
+
+The limited permissions granted above are perpetual and will not be revoked
+by the Internet Society or its successors or assigns.
+
+This document and the information contained herein is provided on an "AS IS"
+basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE
+DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
+ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY
+RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
+PARTICULAR PURPOSE.
+
+
+
+*****************************************************************************
+B) The following software may be included in this product: OpenSSL. Use of
+any of this software is governed by terms of the license below:
+*****************************************************************************
+
+The OpenSSL toolkit stays under a dual license, i.e. both the conditions of
+the OpenSSL License and the original SSLeay license apply to the toolkit.
+See below for the actual license texts. Actually both licenses are BSD-style
+Open Source licenses. In case of any license issues related to OpenSSL please
+contact openssl-core@openssl.org.
+
+OpenSSL License
+====================================================================
+Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+3. All advertising materials mentioning features or use of this software must
+display the following acknowledgment: "This product includes software
+developed by the OpenSSL Project for use in the OpenSSL Toolkit.
+(http://www.openssl.org/)"
+
+4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+endorse or promote products derived from this software without prior written
+permission. For written permission, please contact openssl-core@openssl.org.
+
+5. Products derived from this software may not be called "OpenSSL" nor may
+"OpenSSL" appear in their names without prior written permission of the
+OpenSSL Project.
+
+6. Redistributions of any form whatsoever must retain the following
+acknowledgment: "This product includes software developed by the OpenSSL
+Project for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+
+THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY EXPRESSED
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+NO EVENT SHALL THE OpenSSL PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+====================================================================
+
+This product includes cryptographic software written by Eric Young
+(eay@cryptsoft.com). This product includes software written by Tim Hudson
+(tjh@cryptsoft.com).
+
+ Original SSLeay License
+ -----------------------
+
+Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com)
+All rights reserved.
+
+This package is an SSL implementation written by Eric Young
+(eay@cryptsoft.com). The implementation was written so as to conform with
+Netscapes SSL.
+
+This library is free for commercial and non-commercial use as long as the
+following conditions are adhered to. The following conditions apply to all
+code found in this distribution, be it the RC4, RSA, lhash, DES, etc., code;
+not just the SSL code. The SSL documentation included with this distribution
+is covered by the same copyright terms except that the holder is Tim Hudson
+(tjh@cryptsoft.com).
+
+Copyright remains Eric Young's, and as such any Copyright notices in the code
+are not to be removed. If this package is used in a product, Eric Young
+should be given attribution as the author of the parts of the library used.
+This can be in the form of a textual message at program startup or in
+documentation (online or textual) provided with the package.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the copyright notice, this list
+of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+3. All advertising materials mentioning features or use of this software must
+display the following acknowledgement: "This product includes cryptographic
+software written by Eric Young (eay@cryptsoft.com)" The word 'cryptographic'
+can be left out if the routines from the library being used are not
+cryptographic related :-).
+
+4. If you include any Windows specific code (or a derivative thereof) from
+the apps directory (application code) you must include an acknowledgement:
+"This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+
+THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The license and distribution terms for any publicly available version or
+derivative of this code cannot be changed. i.e. this code cannot simply be
+copied and put under another distribution license [including the GNU Public
+License.]
+
+
+
+*****************************************************************************
+C) The following software may be included in this product: ACE(tm). Use of any
+of this software is governed by terms of the license below:
+*****************************************************************************
+
+Copyright and Licensing Information for ACE(TM), TAO(TM), CIAO(TM), and CoSMIC(TM)
+ACE(TM), TAO(TM), CIAO(TM), and CoSMIC(TM) (henceforth referred to as "DOC
+software") are copyrighted by Douglas C. Schmidt and his research group at
+Washington University, University of California, Irvine, and Vanderbilt
+University, Copyright (c) 1993-2005, all rights reserved. Since DOC software is
+open-source, freely available software, you are free to use, modify, copy,
+and distribute--perpetually and irrevocably--the DOC software source code and
+object code produced from the source, as well as copy and distribute modified
+versions of this software. You must, however, include this copyright
+statement along with code built using DOC software.
+You can use DOC software in commercial and/or binary software releases and
+are under no obligation to redistribute any of your source code that is built
+using DOC software. Note, however, that you may not do anything to the DOC
+software code, such as copyrighting it yourself or claiming authorship of the
+DOC software code, that will prevent DOC software from being distributed
+freely using an open-source development model. You needn't inform anyone that
+you're using DOC software in your software, though we encourage you to let us
+know so we can promote your project in the DOC software success stories.
+The ACE, TAO, CIAO, and CoSMIC web sites are maintained by the DOC Group at
+the Institute for Software Integrated Systems (ISIS) and the Center for
+Distributed Object Computing of Washington University, St. Louis for the
+development of open-source software as part of the open-source software
+community. By submitting comments, suggestions, code, code snippets,
+techniques (including that of usage) and algorithms (collectively
+``Submissions''), submitters acknowledge that they have the right to do so,
+that any such Submissions are given freely and unreservedly, and that they
+waive any claims to copyright or ownership. In addition, submitters
+acknowledge that any such Submission might become part of the copyright
+maintained on the overall body of code that comprises the DOC software. By
+making a Submission, submitter agrees to these terms. Moreover, submitters
+acknowledge that the incorporation or modification of such Submissions is
+entirely at the discretion of the moderators of the open-source DOC software
+projects or their designees.
+Submissions are provided by the submitter ``as is'' with no warranties
+whatsoever, including any warranty of merchantability, noninfringement of
+third party intellectual property, or fitness for any particular purpose. In
+no event shall the submitter be liable for any direct, indirect, special,
+exemplary, punitive, or consequential damages, including without limitation,
+lost profits, even if advised of the possibility of such damages. Likewise,
+DOC software is provided as is with no warranties of any kind, including the
+warranties of design, merchantability, and fitness for a particular purpose,
+noninfringement, or arising from a course of dealing, usage or trade
+practice. Washington University, UC Irvine, Vanderbilt University, their
+employees, and students shall have no liability with respect to the
+infringement of copyrights, trade secrets or any patents by DOC software or
+any part thereof. Moreover, in no event will Washington University, UC
+Irvine, or Vanderbilt University, their employees, or students be liable for
+any lost revenue or profits or other special, indirect and consequential
+damages.
+DOC software is provided with no support and without any obligation on the
+part of Washington University, UC Irvine, Vanderbilt University, their
+employees, or students to assist in its use, correction, modification, or
+enhancement. A number of companies around the world provide commercial
+support for DOC software, however. DOC software is Y2K-compliant, as long as
+the underlying OS platform is Y2K-compliant.
+The names ACE(TM), TAO(TM), CIAO(TM), CoSMIC(TM), Washington University, UC Irvine,
+and Vanderbilt University, may not be used to endorse or promote products or
+services derived from this source without express written permission from
+Washington University, UC Irvine, or Vanderbilt University. Further, products
+or services derived from this source may not be called ACE(TM), TAO(TM), CIAO(TM),
+or CoSMIC(TM) nor may the name Washington University, UC Irvine, or Vanderbilt
+University appear in their names, without express written permission from
+Washington University, UC Irvine, and Vanderbilt University.
+
+
+
+*****************************************************************************
+D) The following software may be included in this product: LibTomCrypt,
+Author: Tom St. Denis. Use of any of this software is licensed under
+PublicDomain. For more information, please visit http://libtomcrypt.org/.
+*****************************************************************************
+
+Copyright and Licensing Information for LibTomCrypt
+LibTomCrypt is a fairly comprehensive, modular and portable cryptographic
+toolkit that provides developers with a vast array of well known published
+block ciphers, one-way hash functions, chaining modes, pseudo-random number
+generators, public key cryptography and a plethora of other routines.
+LibTomCrypt has been designed from the ground up to be very simple to use. It
+has a modular and standard API that allows new ciphers, hashes and PRNGs to
+be added or removed without change to the overall end application. It
+features easy to use functions and a complete user manual which has many
+source snippet examples.
+LibTomCrypt is free for all purposes under the public domain. This includes
+commercial use, redistribution and even branching.
diff --git a/dell_fans_controller/Dell/SysMgt/bmc/solproxy.cfg b/dell_fans_controller/Dell/SysMgt/bmc/solproxy.cfg
new file mode 100644
index 0000000..469e630
--- /dev/null
+++ b/dell_fans_controller/Dell/SysMgt/bmc/solproxy.cfg
@@ -0,0 +1,17 @@
+[parameter]
+ip=INADDR_ANY
+port=623
+session_timeout=30
+power_off_timeout=50
+#debug=off
+#logpath=.
+#sdrcache=enable
+#sdrcache_path=.
+#sol_loss_silent=0
+#sol_loss_threshold=10
+#set_boot_option=auto
+#retry_count=10
+#retry_interval=2
+#user_interface=command
+#max_session=1
+#local_authentication=remote
diff --git a/dell_fans_controller/dell_fans_controller.sln b/dell_fans_controller/dell_fans_controller.sln
new file mode 100644
index 0000000..e832687
--- /dev/null
+++ b/dell_fans_controller/dell_fans_controller.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29709.97
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dell_fans_controller", "dell_fans_controller\dell_fans_controller.csproj", "{01F9EA05-3303-4446-8E37-7B43C28238DC}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {01F9EA05-3303-4446-8E37-7B43C28238DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {01F9EA05-3303-4446-8E37-7B43C28238DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {01F9EA05-3303-4446-8E37-7B43C28238DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {01F9EA05-3303-4446-8E37-7B43C28238DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {40800FCE-106D-4C48-A549-E3CF823099A6}
+ EndGlobalSection
+EndGlobal
diff --git a/dell_fans_controller/dell_fans_controller/FormMain.Designer.cs b/dell_fans_controller/dell_fans_controller/FormMain.Designer.cs
new file mode 100644
index 0000000..7f9a076
--- /dev/null
+++ b/dell_fans_controller/dell_fans_controller/FormMain.Designer.cs
@@ -0,0 +1,418 @@
+namespace dell_fans_controller
+{
+ partial class frmMain
+ {
+ ///
+ /// 必需的设计器变量。
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// 清理所有正在使用的资源。
+ ///
+ /// 如果应释放托管资源,为 true;否则为 false。
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows 窗体设计器生成的代码
+
+ ///
+ /// 设计器支持所需的方法 - 不要修改
+ /// 使用代码编辑器修改此方法的内容。
+ ///
+ private void InitializeComponent()
+ {
+ this.grpMain = new System.Windows.Forms.GroupBox();
+ this.lblPassword = new System.Windows.Forms.Label();
+ this.txtPassword = new System.Windows.Forms.TextBox();
+ this.lblUser = new System.Windows.Forms.Label();
+ this.txtUser = new System.Windows.Forms.TextBox();
+ this.btnVisitDellService = new System.Windows.Forms.Button();
+ this.lblIp = new System.Windows.Forms.Label();
+ this.txtIp = new System.Windows.Forms.TextBox();
+ this.trkBarSpeed = new System.Windows.Forms.TrackBar();
+ this.btnReset = new System.Windows.Forms.Button();
+ this.btnSet = new System.Windows.Forms.Button();
+ this.nbrUpDownSpeed = new System.Windows.Forms.NumericUpDown();
+ this.lblTip = new System.Windows.Forms.Label();
+ this.lnkRepo = new System.Windows.Forms.LinkLabel();
+ this.label1 = new System.Windows.Forms.Label();
+ this.lnkMyWebsite = new System.Windows.Forms.LinkLabel();
+ this.label2 = new System.Windows.Forms.Label();
+ this.lstViewSensor = new System.Windows.Forms.ListView();
+ this.colKey = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.colValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.colUnit = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.colStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.colFaultThresholdMin = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.colWarningThresholdMin = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.colWarningThresholdMax = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.colFaultThresholdMax = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.colExtra = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.nbrUpDownAutoRefresh = new System.Windows.Forms.NumericUpDown();
+ this.lblAutoRefresh = new System.Windows.Forms.Label();
+ this.label3 = new System.Windows.Forms.Label();
+ this.btnRefreshNow = new System.Windows.Forms.Button();
+ this.grpMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.trkBarSpeed)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.nbrUpDownSpeed)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.nbrUpDownAutoRefresh)).BeginInit();
+ this.SuspendLayout();
+ //
+ // grpMain
+ //
+ this.grpMain.Controls.Add(this.lblPassword);
+ this.grpMain.Controls.Add(this.txtPassword);
+ this.grpMain.Controls.Add(this.lblUser);
+ this.grpMain.Controls.Add(this.txtUser);
+ this.grpMain.Controls.Add(this.btnVisitDellService);
+ this.grpMain.Controls.Add(this.lblIp);
+ this.grpMain.Controls.Add(this.txtIp);
+ this.grpMain.Controls.Add(this.trkBarSpeed);
+ this.grpMain.Controls.Add(this.btnReset);
+ this.grpMain.Controls.Add(this.btnSet);
+ this.grpMain.Controls.Add(this.nbrUpDownSpeed);
+ this.grpMain.Location = new System.Drawing.Point(12, 12);
+ this.grpMain.Name = "grpMain";
+ this.grpMain.Size = new System.Drawing.Size(600, 234);
+ this.grpMain.TabIndex = 1;
+ this.grpMain.TabStop = false;
+ this.grpMain.Text = "Fans Speed Control";
+ //
+ // lblPassword
+ //
+ this.lblPassword.AutoSize = true;
+ this.lblPassword.Location = new System.Drawing.Point(332, 37);
+ this.lblPassword.Name = "lblPassword";
+ this.lblPassword.Size = new System.Drawing.Size(53, 12);
+ this.lblPassword.TabIndex = 11;
+ this.lblPassword.Text = "Password";
+ //
+ // txtPassword
+ //
+ this.txtPassword.Location = new System.Drawing.Point(391, 34);
+ this.txtPassword.Name = "txtPassword";
+ this.txtPassword.PasswordChar = '*';
+ this.txtPassword.Size = new System.Drawing.Size(100, 21);
+ this.txtPassword.TabIndex = 10;
+ this.txtPassword.Text = "root";
+ this.txtPassword.LostFocus += new System.EventHandler(this.TxtPassword_LostFocus);
+ //
+ // lblUser
+ //
+ this.lblUser.AutoSize = true;
+ this.lblUser.Location = new System.Drawing.Point(172, 37);
+ this.lblUser.Name = "lblUser";
+ this.lblUser.Size = new System.Drawing.Size(29, 12);
+ this.lblUser.TabIndex = 9;
+ this.lblUser.Text = "User";
+ //
+ // txtUser
+ //
+ this.txtUser.Location = new System.Drawing.Point(207, 34);
+ this.txtUser.Name = "txtUser";
+ this.txtUser.Size = new System.Drawing.Size(100, 21);
+ this.txtUser.TabIndex = 8;
+ this.txtUser.Text = "root";
+ this.txtUser.LostFocus += new System.EventHandler(this.TxtUser_LostFocus);
+ //
+ // btnVisitDellService
+ //
+ this.btnVisitDellService.Location = new System.Drawing.Point(47, 72);
+ this.btnVisitDellService.Name = "btnVisitDellService";
+ this.btnVisitDellService.Size = new System.Drawing.Size(213, 21);
+ this.btnVisitDellService.TabIndex = 7;
+ this.btnVisitDellService.Text = "Visit Dell iDRAC WEB Console";
+ this.btnVisitDellService.UseVisualStyleBackColor = true;
+ this.btnVisitDellService.Click += new System.EventHandler(this.btnVisitDellService_Click);
+ //
+ // lblIp
+ //
+ this.lblIp.AutoSize = true;
+ this.lblIp.Location = new System.Drawing.Point(15, 37);
+ this.lblIp.Name = "lblIp";
+ this.lblIp.Size = new System.Drawing.Size(17, 12);
+ this.lblIp.TabIndex = 6;
+ this.lblIp.Text = "IP";
+ //
+ // txtIp
+ //
+ this.txtIp.Location = new System.Drawing.Point(47, 34);
+ this.txtIp.Name = "txtIp";
+ this.txtIp.Size = new System.Drawing.Size(100, 21);
+ this.txtIp.TabIndex = 5;
+ this.txtIp.Text = "192.168.0.1";
+ this.txtIp.LostFocus += new System.EventHandler(this.TxtIp_LostFocus);
+ //
+ // trkBarSpeed
+ //
+ this.trkBarSpeed.Location = new System.Drawing.Point(17, 116);
+ this.trkBarSpeed.Maximum = 100;
+ this.trkBarSpeed.Name = "trkBarSpeed";
+ this.trkBarSpeed.Size = new System.Drawing.Size(500, 45);
+ this.trkBarSpeed.TabIndex = 4;
+ this.trkBarSpeed.Scroll += new System.EventHandler(this.trkBarSpeed_Scroll);
+ //
+ // btnReset
+ //
+ this.btnReset.Location = new System.Drawing.Point(300, 167);
+ this.btnReset.Name = "btnReset";
+ this.btnReset.Size = new System.Drawing.Size(200, 40);
+ this.btnReset.TabIndex = 3;
+ this.btnReset.Text = "Reset to Auto Mode";
+ this.btnReset.UseVisualStyleBackColor = true;
+ this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
+ //
+ // btnSet
+ //
+ this.btnSet.Location = new System.Drawing.Point(41, 167);
+ this.btnSet.Name = "btnSet";
+ this.btnSet.Size = new System.Drawing.Size(200, 40);
+ this.btnSet.TabIndex = 2;
+ this.btnSet.Text = "Set Speed";
+ this.btnSet.UseVisualStyleBackColor = true;
+ this.btnSet.Click += new System.EventHandler(this.btnSet_Click);
+ //
+ // nbrUpDownSpeed
+ //
+ this.nbrUpDownSpeed.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.nbrUpDownSpeed.Location = new System.Drawing.Point(533, 116);
+ this.nbrUpDownSpeed.Name = "nbrUpDownSpeed";
+ this.nbrUpDownSpeed.Size = new System.Drawing.Size(50, 21);
+ this.nbrUpDownSpeed.TabIndex = 1;
+ this.nbrUpDownSpeed.ValueChanged += new System.EventHandler(this.nbrUpDownSpeed_ValueChanged);
+ //
+ // lblTip
+ //
+ this.lblTip.AutoSize = true;
+ this.lblTip.Location = new System.Drawing.Point(13, 267);
+ this.lblTip.Name = "lblTip";
+ this.lblTip.Size = new System.Drawing.Size(485, 36);
+ this.lblTip.TabIndex = 2;
+ this.lblTip.Text = "拖动上面的滑块为您需要的百分比数值,则服务器风扇转速将会固定为您指定的百分比数值\r\n(注意:风扇实际转速 = 风扇最高转速 * 该百分比数值,\r\n戴尔原厂标配12" +
+ "V电压规格的风扇最高转速通常为 12000 RPM)";
+ //
+ // lnkRepo
+ //
+ this.lnkRepo.AutoSize = true;
+ this.lnkRepo.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
+ this.lnkRepo.Location = new System.Drawing.Point(10, 640);
+ this.lnkRepo.Name = "lnkRepo";
+ this.lnkRepo.Size = new System.Drawing.Size(281, 12);
+ this.lnkRepo.TabIndex = 3;
+ this.lnkRepo.TabStop = true;
+ this.lnkRepo.Text = "https://github.com/cw1997/dell_fans_controller";
+ this.lnkRepo.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkRepo_LinkClicked);
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(13, 324);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(557, 24);
+ this.label1.TabIndex = 4;
+ this.label1.Text = "若需要恢复到自动转速模式,点击上面的“Reset to auto mode”即可\r\n自动转速模式下,由服务器内部的传感器根据温度情况自动调整转速,这也是戴尔服务器" +
+ "的出厂默认模式";
+ //
+ // lnkMyWebsite
+ //
+ this.lnkMyWebsite.AutoSize = true;
+ this.lnkMyWebsite.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
+ this.lnkMyWebsite.Location = new System.Drawing.Point(399, 640);
+ this.lnkMyWebsite.Name = "lnkMyWebsite";
+ this.lnkMyWebsite.Size = new System.Drawing.Size(113, 12);
+ this.lnkMyWebsite.TabIndex = 5;
+ this.lnkMyWebsite.TabStop = true;
+ this.lnkMyWebsite.Text = "http://changwei.me";
+ this.lnkMyWebsite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkMyWebsite_LinkClicked);
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(523, 640);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(89, 12);
+ this.label2.TabIndex = 6;
+ this.label2.Text = "Code By cw1997";
+ //
+ // lstViewSensor
+ //
+ this.lstViewSensor.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.colKey,
+ this.colValue,
+ this.colUnit,
+ this.colStatus,
+ this.colFaultThresholdMin,
+ this.colWarningThresholdMin,
+ this.colWarningThresholdMax,
+ this.colFaultThresholdMax,
+ this.colExtra});
+ this.lstViewSensor.FullRowSelect = true;
+ this.lstViewSensor.GridLines = true;
+ this.lstViewSensor.HideSelection = false;
+ this.lstViewSensor.Location = new System.Drawing.Point(12, 395);
+ this.lstViewSensor.Name = "lstViewSensor";
+ this.lstViewSensor.Size = new System.Drawing.Size(600, 226);
+ this.lstViewSensor.TabIndex = 7;
+ this.lstViewSensor.UseCompatibleStateImageBehavior = false;
+ this.lstViewSensor.View = System.Windows.Forms.View.Details;
+ //
+ // colKey
+ //
+ this.colKey.Text = "Key";
+ this.colKey.Width = 100;
+ //
+ // colValue
+ //
+ this.colValue.Text = "Value";
+ this.colValue.Width = 100;
+ //
+ // colUnit
+ //
+ this.colUnit.Text = "Unit";
+ //
+ // colStatus
+ //
+ this.colStatus.Text = "Status";
+ //
+ // colFaultThresholdMin
+ //
+ this.colFaultThresholdMin.Text = "FaultThresholdMin";
+ this.colFaultThresholdMin.Width = 78;
+ //
+ // colWarningThresholdMin
+ //
+ this.colWarningThresholdMin.Text = "WarningThresholdMin";
+ this.colWarningThresholdMin.Width = 79;
+ //
+ // colWarningThresholdMax
+ //
+ this.colWarningThresholdMax.Text = "WarningThresholdMax";
+ this.colWarningThresholdMax.Width = 80;
+ //
+ // colFaultThresholdMax
+ //
+ this.colFaultThresholdMax.Text = "FaultThresholdMax";
+ this.colFaultThresholdMax.Width = 74;
+ //
+ // colExtra
+ //
+ this.colExtra.Text = "Extra";
+ //
+ // nbrUpDownAutoRefresh
+ //
+ this.nbrUpDownAutoRefresh.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.nbrUpDownAutoRefresh.Location = new System.Drawing.Point(132, 368);
+ this.nbrUpDownAutoRefresh.Name = "nbrUpDownAutoRefresh";
+ this.nbrUpDownAutoRefresh.Size = new System.Drawing.Size(50, 21);
+ this.nbrUpDownAutoRefresh.TabIndex = 12;
+ this.nbrUpDownAutoRefresh.Tag = " TODO: by cw1997 2020-06-24 22:58:37";
+ this.nbrUpDownAutoRefresh.Value = new decimal(new int[] {
+ 20,
+ 0,
+ 0,
+ 0});
+ this.nbrUpDownAutoRefresh.Visible = false;
+ //
+ // lblAutoRefresh
+ //
+ this.lblAutoRefresh.AutoSize = true;
+ this.lblAutoRefresh.Location = new System.Drawing.Point(13, 370);
+ this.lblAutoRefresh.Name = "lblAutoRefresh";
+ this.lblAutoRefresh.Size = new System.Drawing.Size(113, 12);
+ this.lblAutoRefresh.TabIndex = 12;
+ this.lblAutoRefresh.Text = "Auto Refresh Delay";
+ this.lblAutoRefresh.Visible = false;
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(188, 370);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(53, 12);
+ this.label3.TabIndex = 13;
+ this.label3.Text = "(second)";
+ this.label3.Visible = false;
+ //
+ // btnRefreshNow
+ //
+ this.btnRefreshNow.Location = new System.Drawing.Point(433, 366);
+ this.btnRefreshNow.Name = "btnRefreshNow";
+ this.btnRefreshNow.Size = new System.Drawing.Size(179, 21);
+ this.btnRefreshNow.TabIndex = 12;
+ this.btnRefreshNow.Text = "Refresh Now";
+ this.btnRefreshNow.UseVisualStyleBackColor = true;
+ this.btnRefreshNow.Click += new System.EventHandler(this.btnRefreshNow_Click);
+ //
+ // frmMain
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(624, 661);
+ this.Controls.Add(this.btnRefreshNow);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.lblAutoRefresh);
+ this.Controls.Add(this.nbrUpDownAutoRefresh);
+ this.Controls.Add(this.lstViewSensor);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.lnkMyWebsite);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.lnkRepo);
+ this.Controls.Add(this.lblTip);
+ this.Controls.Add(this.grpMain);
+ this.HelpButton = true;
+ this.MaximizeBox = false;
+ this.Name = "frmMain";
+ this.Text = "Dell Fans Speed Controller";
+ this.Load += new System.EventHandler(this.frmMain_Load);
+ this.grpMain.ResumeLayout(false);
+ this.grpMain.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.trkBarSpeed)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.nbrUpDownSpeed)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.nbrUpDownAutoRefresh)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+ private System.Windows.Forms.GroupBox grpMain;
+ private System.Windows.Forms.TrackBar trkBarSpeed;
+ private System.Windows.Forms.Button btnReset;
+ private System.Windows.Forms.Button btnSet;
+ private System.Windows.Forms.NumericUpDown nbrUpDownSpeed;
+ private System.Windows.Forms.Label lblTip;
+ private System.Windows.Forms.LinkLabel lnkRepo;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.LinkLabel lnkMyWebsite;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Button btnVisitDellService;
+ private System.Windows.Forms.Label lblIp;
+ private System.Windows.Forms.TextBox txtIp;
+ private System.Windows.Forms.Label lblPassword;
+ private System.Windows.Forms.TextBox txtPassword;
+ private System.Windows.Forms.Label lblUser;
+ private System.Windows.Forms.TextBox txtUser;
+ private System.Windows.Forms.ListView lstViewSensor;
+ private System.Windows.Forms.ColumnHeader colValue;
+ private System.Windows.Forms.ColumnHeader colUnit;
+ private System.Windows.Forms.ColumnHeader colStatus;
+ private System.Windows.Forms.ColumnHeader colFaultThresholdMin;
+ private System.Windows.Forms.ColumnHeader colWarningThresholdMin;
+ private System.Windows.Forms.ColumnHeader colWarningThresholdMax;
+ private System.Windows.Forms.ColumnHeader colFaultThresholdMax;
+ private System.Windows.Forms.ColumnHeader colExtra;
+ private System.Windows.Forms.Label lblAutoRefresh;
+ private System.Windows.Forms.NumericUpDown nbrUpDownAutoRefresh;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Button btnRefreshNow;
+ private System.Windows.Forms.ColumnHeader colKey;
+ }
+}
+
diff --git a/dell_fans_controller/dell_fans_controller/FormMain.cs b/dell_fans_controller/dell_fans_controller/FormMain.cs
new file mode 100644
index 0000000..d014e10
--- /dev/null
+++ b/dell_fans_controller/dell_fans_controller/FormMain.cs
@@ -0,0 +1,207 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Diagnostics;
+using System.Drawing;
+using System.IO;
+using System.Text;
+using System.Windows.Forms;
+
+namespace dell_fans_controller
+{
+ public partial class frmMain : Form
+ {
+ private static string version = "v1.0.0";
+
+ private static string currentPath = Application.StartupPath; // System.Environment.CurrentDirectory;
+ private static string configFileName = "\\config.ini";
+ private static string explorer = "explorer";
+ private static string ipmitoolPath = currentPath + "\\Dell\\SysMgt\\bmc\\ipmitool.exe";
+ private static string configFilePath = currentPath + configFileName;
+
+ private static string defaultIp = "127.0.0.1";
+ private static string defaultUser = "root";
+ private static string defaultPassword = "calvin";
+ private static string defaultConfigSection = "ipmi";
+
+ private static string execute(string parameter)
+ {
+ Process process = null;
+ string result = string.Empty;
+ try
+ {
+ process = new Process();
+ process.StartInfo.FileName = "cmd.exe";
+ process.StartInfo.UseShellExecute = false;
+ process.StartInfo.CreateNoWindow = true;
+ process.StartInfo.RedirectStandardInput = true;
+ process.StartInfo.RedirectStandardOutput = true;
+ process.StartInfo.RedirectStandardError = true;
+
+ process.Start();
+
+ process.StandardInput.WriteLine(parameter + "& exit");
+ process.StandardInput.AutoFlush = true;
+ result = process.StandardOutput.ReadToEnd();
+ process.WaitForExit();
+ process.Close();
+ return result;
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine("ExceptionOccurred:{ 0},{ 1}", ex.Message, ex.StackTrace.ToString());
+ return null;
+ }
+ }
+
+ private void saveConfig()
+ {
+ string ip = txtIp.Text;
+ string user = txtUser.Text;
+ string password = txtPassword.Text;
+
+ IniHelper.Write(defaultConfigSection, "ip", ip, configFilePath);
+ IniHelper.Write(defaultConfigSection, "user", user, configFilePath);
+ IniHelper.Write(defaultConfigSection, "password", password, configFilePath);
+ }
+
+ public frmMain()
+ {
+ InitializeComponent();
+
+
+ if (File.Exists(configFilePath))
+ {
+ string ip = IniHelper.Read(defaultConfigSection, "ip", defaultIp, configFilePath);
+ string user = IniHelper.Read(defaultConfigSection, "user", defaultUser, configFilePath);
+ string password = IniHelper.Read(defaultConfigSection, "password", defaultPassword, configFilePath);
+ txtIp.Text = ip;
+ txtUser.Text = user;
+ txtPassword.Text = password;
+ }
+ else
+ {
+ IniHelper.Write(defaultConfigSection, "ip", defaultIp, configFilePath);
+ IniHelper.Write(defaultConfigSection, "user", defaultUser, configFilePath);
+ IniHelper.Write(defaultConfigSection, "password", defaultPassword, configFilePath);
+ txtIp.Text = defaultIp;
+ txtUser.Text = defaultUser;
+ txtPassword.Text = defaultPassword;
+ }
+
+ }
+
+ private void nbrUpDownSpeed_ValueChanged(object sender, EventArgs e)
+ {
+ trkBarSpeed.Value = (int)nbrUpDownSpeed.Value;
+ }
+
+ private void btnReset_Click(object sender, EventArgs e)
+ {
+ string ip = txtIp.Text;
+ string user = txtUser.Text;
+ string password = txtPassword.Text;
+
+ string parametersReset = string.Format("-I lanplus -H {0} -U {1} -P {2} raw 0x30 0x30 0x01 0x01", ip, user, password);
+
+ string fullExecuteReset = ipmitoolPath + " " + parametersReset;
+ execute(fullExecuteReset);
+ }
+
+ private void btnSet_Click(object sender, EventArgs e)
+ {
+ string ip = txtIp.Text;
+ string user = txtUser.Text;
+ string password = txtPassword.Text;
+ string percent = nbrUpDownSpeed.Text;
+ int percentNum = int.Parse(percent);
+
+ // string format = "%s/Dell/SysMgt/bmc/ipmitool.exe -I lanplus -H %s -U %s -P %s raw 0x30 0x30 0x01";
+ string formatDisableAutoMode = "-I lanplus -H {0} -U {1} -P {2} raw 0x30 0x30 0x01 0x00";
+ string parametersDisableAutoMode = string.Format(formatDisableAutoMode, ip, user, password);
+
+ string fullExecuteDisableAutoMode = ipmitoolPath + " " + parametersDisableAutoMode;
+ string resultDisableAutoMode = execute(fullExecuteDisableAutoMode);
+
+
+ // format = "%s/Dell/SysMgt/bmc/ipmitool.exe -I lanplus -H %s -U %s -P %s raw 0x30 0x30 0x02 0xff 0x%02x";
+ string formatSetSpeed = "-I lanplus -H {0} -U {1} -P {2} raw 0x30 0x30 0x02 0xff 0x{3:x2}";
+ string parametersSetSpeed = string.Format(formatSetSpeed, ip, user, password, percentNum);
+
+ string fullExecuteSetSpeed = ipmitoolPath + " " + parametersSetSpeed;
+ string resultSetSpeed = execute(fullExecuteSetSpeed);
+
+ // MessageBox.Show(resultDisableAutoMode + "-" + resultSetSpeed);
+
+ //string cmdFormat = "/k \"{0} {1}\" & \"{2} {3}\"";
+ //string cmdParameters = string.Format(cmdFormat, ipmitoolPath, parametersDisableAutoMode, ipmitoolPath, parametersSetSpeed);
+
+ //Process.Start("cmd", cmdParameters);
+ }
+
+ private void lnkRepo_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+ {
+ Process.Start(explorer, lnkRepo.Text);
+ }
+
+ private void lnkMyWebsite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+ {
+ Process.Start(explorer, lnkMyWebsite.Text);
+ }
+
+ private void btnVisitDellService_Click(object sender, EventArgs e)
+ {
+ Process.Start(explorer, "http://" + txtIp.Text);
+ }
+
+ private void trkBarSpeed_Scroll(object sender, EventArgs e)
+ {
+ nbrUpDownSpeed.Value = trkBarSpeed.Value;
+ }
+
+ private void btnRefreshNow_Click(object sender, EventArgs e)
+ {
+ string ip = txtIp.Text;
+ string user = txtUser.Text;
+ string password = txtPassword.Text;
+
+ string formatSensor = "-I lanplus -H {0} -U {1} -P {2} sensor";
+ string parametersSensor = string.Format(formatSensor, ip, user, password);
+
+ string fullExecuteSensor = ipmitoolPath + " " + parametersSensor;
+ string result = execute(fullExecuteSensor);
+
+ result = result.Replace("\r\n", "\n");
+ string[] sensorList = result.Split('\n', '\r');
+
+ lstViewSensor.Items.Clear();
+ foreach (var item in sensorList) {
+ if (item.Contains("Temp") || item.Contains("RPM") || item.Contains("Voltage") || item.Contains("Current")) {
+ lstViewSensor.Items.Add(new ListViewItem(item.Split('|')));
+ }
+ }
+ }
+
+ private void TxtIp_LostFocus(object sender, EventArgs e)
+ {
+ saveConfig();
+ }
+
+ private void TxtUser_LostFocus(object sender, EventArgs e)
+ {
+ saveConfig();
+ }
+
+ private void TxtPassword_LostFocus(object sender, EventArgs e)
+ {
+ saveConfig();
+ }
+
+ private void frmMain_Load(object sender, EventArgs e)
+ {
+
+ this.Text += " " + version;
+ }
+ }
+}
diff --git a/dell_fans_controller/dell_fans_controller/FormMain.resx b/dell_fans_controller/dell_fans_controller/FormMain.resx
new file mode 100644
index 0000000..7080a7d
--- /dev/null
+++ b/dell_fans_controller/dell_fans_controller/FormMain.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/dell_fans_controller/dell_fans_controller/IniHelper.cs b/dell_fans_controller/dell_fans_controller/IniHelper.cs
new file mode 100644
index 0000000..f7eab8a
--- /dev/null
+++ b/dell_fans_controller/dell_fans_controller/IniHelper.cs
@@ -0,0 +1,90 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace dell_fans_controller
+{
+ public class IniHelper
+ {
+ public IniHelper()
+ {
+ }
+
+ ///
+ /// 为INI文件中指定的节点取得字符串
+ ///
+ /// 欲在其中查找关键字的节点名称
+ /// 欲获取的项名
+ /// 指定的项没有找到时返回的默认值
+ /// 指定一个字串缓冲区,长度至少为nSize
+ /// 指定装载到lpReturnedString缓冲区的最大字符数量
+ /// INI文件完整路径
+ /// 复制到lpReturnedString缓冲区的字节数量,其中不包括那些NULL中止字符
+ [DllImport("kernel32")]
+ private static extern int GetPrivateProfileString(string lpAppName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, int nSize, string lpFileName);
+
+ ///
+ /// 修改INI文件中内容
+ ///
+ /// 欲在其中写入的节点名称
+ /// 欲设置的项名
+ /// 要写入的新字符串
+ /// INI文件完整路径
+ /// 非零表示成功,零表示失败
+ [DllImport("kernel32")]
+ private static extern int WritePrivateProfileString(string lpApplicationName, string lpKeyName, string lpString, string lpFileName);
+
+ ///
+ /// 读取INI文件值
+ ///
+ /// 节点名
+ /// 键
+ /// 未取到值时返回的默认值
+ /// INI文件完整路径
+ /// 读取的值
+ public static string Read(string section, string key, string def, string filePath)
+ {
+ StringBuilder sb = new StringBuilder(1024);
+ GetPrivateProfileString(section, key, def, sb, 1024, filePath);
+ return sb.ToString();
+ }
+
+ ///
+ /// 写INI文件值
+ ///
+ /// 欲在其中写入的节点名称
+ /// 欲设置的项名
+ /// 要写入的新字符串
+ /// INI文件完整路径
+ /// 非零表示成功,零表示失败
+ public static int Write(string section, string key, string value, string filePath)
+ {
+ //CheckPath(filePath);
+ return WritePrivateProfileString(section, key, value, filePath);
+ }
+
+ ///
+ /// 删除节
+ ///
+ /// 节点名
+ /// INI文件完整路径
+ /// 非零表示成功,零表示失败
+ public static int DeleteSection(string section, string filePath)
+ {
+ return Write(section, null, null, filePath);
+ }
+
+ ///
+ /// 删除键的值
+ ///
+ /// 节点名
+ /// 键名
+ /// INI文件完整路径
+ /// 非零表示成功,零表示失败
+ public static int DeleteKey(string section, string key, string filePath)
+ {
+ return Write(section, key, null, filePath);
+ }
+ }
+
+}
diff --git a/dell_fans_controller/dell_fans_controller/Program.cs b/dell_fans_controller/dell_fans_controller/Program.cs
new file mode 100644
index 0000000..00375c0
--- /dev/null
+++ b/dell_fans_controller/dell_fans_controller/Program.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+namespace dell_fans_controller
+{
+ static class Program
+ {
+ ///
+ /// 应用程序的主入口点。
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new frmMain());
+ }
+ }
+}
diff --git a/dell_fans_controller/dell_fans_controller/Properties/AssemblyInfo.cs b/dell_fans_controller/dell_fans_controller/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..ca43d42
--- /dev/null
+++ b/dell_fans_controller/dell_fans_controller/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("dell_fans_controller")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("dell_fans_controller")]
+[assembly: AssemblyCopyright("Copyright © 2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("01f9ea05-3303-4446-8e37-7b43c28238dc")]
+
+// 程序集的版本信息由下列四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/dell_fans_controller/dell_fans_controller/Properties/Resources.Designer.cs b/dell_fans_controller/dell_fans_controller/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..bfd733f
--- /dev/null
+++ b/dell_fans_controller/dell_fans_controller/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本: 4.0.30319.42000
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace dell_fans_controller.Properties
+{
+
+
+ ///
+ /// 强类型资源类,用于查找本地化字符串等。
+ ///
+ // 此类是由 StronglyTypedResourceBuilder
+ // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+ // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // (以 /str 作为命令选项),或重新生成 VS 项目。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// 返回此类使用的缓存 ResourceManager 实例。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("dell_fans_controller.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 覆盖当前线程的 CurrentUICulture 属性
+ /// 使用此强类型的资源类的资源查找。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/dell_fans_controller/dell_fans_controller/Properties/Resources.resx b/dell_fans_controller/dell_fans_controller/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/dell_fans_controller/dell_fans_controller/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/dell_fans_controller/dell_fans_controller/Properties/Settings.Designer.cs b/dell_fans_controller/dell_fans_controller/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..620d14e
--- /dev/null
+++ b/dell_fans_controller/dell_fans_controller/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace dell_fans_controller.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/dell_fans_controller/dell_fans_controller/Properties/Settings.settings b/dell_fans_controller/dell_fans_controller/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/dell_fans_controller/dell_fans_controller/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/dell_fans_controller/dell_fans_controller/dell_fans_controller.csproj b/dell_fans_controller/dell_fans_controller/dell_fans_controller.csproj
new file mode 100644
index 0000000..54af414
--- /dev/null
+++ b/dell_fans_controller/dell_fans_controller/dell_fans_controller.csproj
@@ -0,0 +1,111 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {01F9EA05-3303-4446-8E37-7B43C28238DC}
+ WinExe
+ dell_fans_controller
+ dell_fans_controller
+ v2.0
+ 512
+ true
+ false
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 1
+ 1.0.0.%2a
+ false
+ true
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+ 974FCA397D2202D377050D9C0E46AD199904D5B5
+
+
+ dell_fans_controller_TemporaryKey.pfx
+
+
+ true
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ FormMain.cs
+
+
+
+
+
+ FormMain.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+ False
+ .NET Framework 3.5 SP1
+ true
+
+
+
+
\ No newline at end of file