調整我的最愛,遙控器測試
This commit is contained in:
parent
27f71af8c8
commit
743f774247
@ -27,7 +27,8 @@ namespace DualScreenDemo
|
|||||||
public async Task ProcessData(string indata)
|
public async Task ProcessData(string indata)
|
||||||
{
|
{
|
||||||
AddToHistory(indata);
|
AddToHistory(indata);
|
||||||
|
// 遙控器測試
|
||||||
|
Console.WriteLine("遙控器:" + indata);
|
||||||
switch (indata)
|
switch (indata)
|
||||||
{
|
{
|
||||||
case "A261A4": // 輸入
|
case "A261A4": // 輸入
|
||||||
@ -203,10 +204,8 @@ namespace DualScreenDemo
|
|||||||
if (_indataHistory.Count == targetSequence.Length &&
|
if (_indataHistory.Count == targetSequence.Length &&
|
||||||
_indataHistory.SequenceEqual(targetSequence))
|
_indataHistory.SequenceEqual(targetSequence))
|
||||||
{
|
{
|
||||||
// 👇 這裡就是條件符合時要做的事情
|
|
||||||
Console.WriteLine("Shutdown condition met. Application will now close.");
|
Console.WriteLine("Shutdown condition met. Application will now close.");
|
||||||
ShutdownComputer();
|
ShutdownComputer();
|
||||||
// 你可以呼叫其他方法、觸發事件、改狀態等等
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ namespace DualScreenDemo{
|
|||||||
}
|
}
|
||||||
public void InsertNewFavoriteSong(string songNumber){
|
public void InsertNewFavoriteSong(string songNumber){
|
||||||
|
|
||||||
string query = $"INSERT INTO FavoriteSongs (Phonenumber,SongNumber) VALUES ('{userPhone}','{songNumber}');";
|
string query = $"INSERT INTO FavoriteSongs (userPhone,songNumber) VALUES ('{userPhone}','{songNumber}');";
|
||||||
Console.WriteLine(query);
|
Console.WriteLine(query);
|
||||||
string connectionString = "Server=192.168.11.4;Port=3306;Database=Karaoke-Kingpin;User=Karaoke-Kingpin;Password=ESM7yTPMnavFmbBH;";
|
string connectionString = "Server=192.168.11.4;Port=3306;Database=Karaoke-Kingpin;User=Karaoke-Kingpin;Password=ESM7yTPMnavFmbBH;";
|
||||||
|
|
||||||
@ -128,8 +128,8 @@ namespace DualScreenDemo{
|
|||||||
string query = $"SELECT " +
|
string query = $"SELECT " +
|
||||||
"sl.*"+
|
"sl.*"+
|
||||||
"FROM FavoriteSongs fs " +
|
"FROM FavoriteSongs fs " +
|
||||||
"JOIN song_library_cache sl ON fs.SongNumber = sl.song_id " +
|
"JOIN song_library_cache sl ON fs.songNumber = sl.song_id " +
|
||||||
$"WHERE fs.Phonenumber = '{userPhone}';";
|
$"WHERE fs.userPhone = '{userPhone}';";
|
||||||
return query;
|
return query;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -140,7 +140,7 @@ namespace DualScreenDemo{
|
|||||||
{
|
{
|
||||||
connection.Open();
|
connection.Open();
|
||||||
Console.WriteLine("MyDB 連線成功!");
|
Console.WriteLine("MyDB 連線成功!");
|
||||||
string query = $"SELECT COUNT(*) FROM FavoriteSongs WHERE Phonenumber = '{phonenumber}'";
|
string query = $"SELECT COUNT(*) FROM FavoriteSongs WHERE userPhone = '{phonenumber}'";
|
||||||
using (var command = new MySqlCommand(query, connection)){
|
using (var command = new MySqlCommand(query, connection)){
|
||||||
int count = Convert.ToInt32(command.ExecuteScalar());
|
int count = Convert.ToInt32(command.ExecuteScalar());
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user