^_^
@MaxySpark
I made a script to download song from a text file using nodejs
I am beginner so there may be some bug :p
Hope you will like it :D
https://github.com/MaxySpark/Song-Playlist-Downloader-NodeJS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Threading;
namespace MyFirstChatBot
{
class Program
{
static void Main(string[] args)
{
bool shutdown = false;
bool foundResponse;
string inputValue;
string outputValue = "";
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Computer: Hello Friend!");
Console.WriteLine("");
Console.ResetColor();
while (!shutdown)
{
foundResponse = false;
Console.ForegroundColor = ConsoleColor.White;
Console.Write("User: ");
inputValue = Console.ReadLine().ToLower();
Console.WriteLine("");
Console.ForegroundColor = ConsoleColor.Green;
Console.Write("Computer: ");
switch (inputValue)
{
case "hello":
outputValue = "I've already said Hello.";
foundResponse = true;
break;
case "bye":
outputValue = "Good bye";
foundResponse = true;
break;
case "notepad":
Process ExternalProcess = new Process();
outputValue = ExternalProcess.StartInfo.FileName = "Notepad.exe";
foundResponse = true;
ExternalProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
ExternalProcess.Start();
ExternalProcess.WaitForExit();
break;
}
}
if (foundResponse)
{
Console.WriteLine(outputValue);
}
else
{
Console.WriteLine("Found no response.");
}
Console.WriteLine("");
Console.ResetColor();
}
}
}
}
private void LoadColors()
{
string Line;
string Line2 = null;
string[] Lines;
string[] Lines2;
bool Found = false;
string Line1;
StreamReader reader = null;
StreamReader reader2 = null;
//Diynamically Make Controls
Panel panel = new Panel();
Label label = new Label();
TextBox textbox = new TextBox();
Button button = new Button();
panel.Size = new Size(398, 35);
label.Size = new Size(157, 13);
textbox.Size = new Size(83, 20);
button.Size = new Size(75, 23);
button.BackColor = Color.FromName("ButtonFace");
button.Text = "Select";
panel.Controls.Add(label);
label.Location = new Point(3, 12);
panel.Controls.Add(textbox);
textbox.Location = new Point(231, 8);
panel.Controls.Add(button);
button.Location = new Point(320, 6);
//ReadFile
reader = new StreamReader("colors.tdesktop-theme");
Line = reader.ReadLine();
while (Line != null)
{
if (!Line.StartsWith("//") |Line != "")
{
Lines = Line.Split(':');
// MessageBox.Show(Lines[0]+Lines[1]);
Lines[1]= Lines[1].Replace(" ", "");
Lines[1]=Lines[1].Replace(";","");
// MessageBox.Show(Lines[0] + Lines[1]);
if (Lines.Length > 1)
{
label.Text = Lines[0];
}
string Line12 = Lines[1];
if (Line12.StartsWith("#"))
{
textbox.Text = Lines[1].ToString();
}
else
{
reader2 = new StreamReader("colors.tdesktop-theme");
while (Found)
{
Line2 = reader2.ReadLine();
if (Line2.StartsWith(Lines[1]))
{
Lines2 = Line2.Split(':');
textbox.Text = Lines2[1];
}
Found = true;
}
}
textbox.BackColor = ColorTranslator.FromHtml(textbox.Text);