Как я могу управлять скоростью вентилятора своего ПК с помощью C++ в Vista?

Это просто через класс Win32_ComputerSystem WMI :

# Fetch the `Win32_ComputerSystem` instance on localhost
$CS = Get-CimInstance Win32_ComputerSystem

# Unjoin old domain
$CS |Invoke-CimMethod -MethodName UnjoinDomainOrWorkGroup -Arguments @{
  FUnjoinOptions = 4
  Password = $DomainPassword
  UserName = $DomainUser
}

# Rename the computer
$CS |Invoke-CimMethod -MethodName Rename -Arguments @{
  Name = $NewComputerName
}

# Join the new domain
$CS |Invoke-CimMethod -MethodName JoinDomainOrWorkGroup -Arguments @{
  AccountOU = 'OU=Computers,DC=new,DC=domain,DC=tld'
  FJoinOptions = 0
  Name = 'new.domain.tld'
  Password = $NewDomainPassword
  UserName = $NewDomainUser
}

5
задан bmargulies 20 January 2014 в 02:18
поделиться

1 ответ

Your suggestion IS the elegant, powerful, best practice solution.

Since I don't think the other answers said the following strongly enough, I'm going to do it.

If your developers 1) can't understand how to model a many-to-many relationship in a relational database, and 2) strongly insist on storing your CategoryIDs as delimited character data,

Then they ought to immediately lose all database design privileges. At the very least, they need an actual experienced professional to join their team who has the authority to stop them from doing something this unwise and can give them the database design training they are completely lacking.

Last, you should not refer to them as "database developers" again until they are properly up to speed, as this is a slight to those of us who actually are competent developers & designers.

I hope this answer is very helpful to you.

Update

The main point of my question is not developer confusion and what to do about it.

The point is to understand when delimited values are the right solution.

Delimited values are the wrong solution except in extremely rare cases. When individual values will ever be queried/inserted/deleted/updated this proves it was the wrong decision, because you have to parse and touch all the other values just to work with the desired one. By doing this you're violating first (!!!) normal form (this phrase should sound to you like an unbelievably vile expletive). Using XML to do the same thing is wrong, too. Storing delimited values or multi-value XML in a column could make sense when it is treated as an indivisible and opaque "property bag" that is NOT queried on by the database but is always sent whole to another consumer (perhaps a web server or an EDI recipient).

This takes me back to my initial comment. Developers who think violating first normal form is a good idea are very inexperienced developers in my book.

I will grant there are some pretty sophisticated non-relational data storage implementations out there using text property bags (such as Facebook(?) and other multi-million user sites running on thousands of servers). Well, when your database, user base, and transactions per second are big enough to need that, you'll have the money to develop it. In the meantime, stick with best practice.

--121 --- 1695470--

У меня такое же чувство. Старая справочная система помогает мне быстрее найти ответ.

--121 --- 3367495--

ACPI:

Вам необходимо изучить и использовать интерфейс управления системой WMI - Windows. Вот несколько ресурсов, которые помогут вам понять, с чего начать:

Обратите внимание, что некоторые материнские платы не поддержите изменения скорости вентилятора, и даже те, которые не могут выставить это WMI. В лучшем случае вам, возможно, все же придется определить тип материнской платы и напрямую поговорить с контроллерами управления вентиляторами.

Нет ACPI:

Если вы не хотите использовать ACPI, вам придется написать свой свой собственный код для доступа к SMBUS на материнской плате, а затем для управления микросхемами контроллера вентилятора.

Проверьте монитор материнской платы программы, чтобы узнать, как начать работу. Это нетривиально,

6
ответ дан 14 December 2019 в 13:46
поделиться
Другие вопросы по тегам:

Похожие вопросы: