本文整理汇总了C#中System.Net.WebClient.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# System.Net.WebClient.Contains方法的具体用法?C# System.Net.WebClient.Contains怎么用?C# System.Net.WebClient.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Net.WebClient
的用法示例。
在下文中一共展示了System.Net.WebClient.Contains方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: t_Tick
//.........这里部分代码省略.........
if (!Directory.Exists(Program.tools + "ice"))
{
splash.vis();
new DFC().extract(splash.pb);
DialogResult dr = MessageBox.Show(
"Would you like me to perform the necessary\n" +
"changes to the Traktor configuration files?",
"Automatic Install Prompt",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
if (dr == System.Windows.Forms.DialogResult.Yes)
{
string path = System.Environment.GetEnvironmentVariable("USERPROFILE") + "\\";
string try1 = path + "Documents\\Native Instruments";
string try2 = path + "Native Instruments";
//MessageBox.Show(path);
if (Directory.Exists(try1)) path = try1;
else if (Directory.Exists(try2)) path = try2;
else
{
MessageBox.Show("Could not find the location of Traktor on your system.");
Program.kill();
}
bool messaged = false;
foreach (string str in Directory.GetDirectories(path))
{
string fpath = str + "\\Traktor Settings.tsi";
if (!File.Exists(fpath)) continue;
if (!messaged)
{
MessageBox.Show("About to modify the following config file:\n\n" + fpath + "\n\nPlease make sure that Traktor is completely\nshut down before proceeding.");
}
var enc = new System.Text.UTF8Encoding(false);
string[] data = System.IO.File.ReadAllText(fpath, enc).Split('\n');
int matches = 0;
for (int a = 0; a < data.Length; a++)
{
string s = data[a] + 's';
if (s.StartsWith("<Entry Name=\"Broadcast.IcecastServer.Address\"")) s = setvalue(data[a], "127.0.0.1");
if (s.StartsWith("<Entry Name=\"Broadcast.IcecastServer.MountPath\"")) s = setvalue(data[a], "/why.ogg");
if (s.StartsWith("<Entry Name=\"Broadcast.IcecastServer.Password\"")) s = setvalue(data[a], "loopstream");
if (s.StartsWith("<Entry Name=\"Broadcast.IcecastServer.Port\"")) s = setvalue(data[a], "42069");
if (s != data[a] + 's')
{
matches++;
data[a] = s;
}
}
if (matches == 4)
{
StringBuilder sb = new StringBuilder();
foreach (string ss in data)
{
sb.Append(ss);
sb.Append('\n');
}
System.IO.File.WriteAllText(fpath, sb.ToString(), enc);
}
else
{
MessageBox.Show("Failed to configure Traktor:\n\nUnable to parse config file");
Program.kill();
}
}
MessageBox.Show("Traktor configuration successful.");
}
}
splash.unvis();
splash.fx = false;
splash.gtfo();
System.Diagnostics.Process proc;
proc = new System.Diagnostics.Process();
proc.StartInfo = new System.Diagnostics.ProcessStartInfo(
"traktor2loopstream.exe",
"-c icecast.xml");
proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
proc.StartInfo.WorkingDirectory = Program.tools + "ice";
proc.Start();
while (true)
{
try
{
string str = new System.Net.WebClient().DownloadString("http://127.0.0.1:42069/status2.xsl");
if (str.Contains("<pre>"))
{
break;
}
}
catch { }
Application.DoEvents();
System.Threading.Thread.Sleep(500);
}
Application.DoEvents();
Program.kill();
}