本文整理汇总了C#中System.Windows.Forms.TextBox.Replace方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.Replace方法的具体用法?C# TextBox.Replace怎么用?C# TextBox.Replace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TextBox
的用法示例。
在下文中一共展示了TextBox.Replace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: doPush
private void doPush(int how,string fname)
{
string results="";
string[] resAr;
bool isMe = true;
string theFileName = pushFileName;
string extraPath = "";
debugMessage("-Entering doPush");
if (how == 1)
{
theFileName = fname;
extraPath = "\\messages";
}
try
{
//System.IO.FileStream myFile = System.IO.File.Open(filePath + extraPath + "\\" + theFileName,System.IO.FileMode.Open,System.IO.FileAccess.Read,System.IO.FileShare.Read);
//for (int i=0;i<myFile.Length;i++)
results += systemInventory.readTextFile(filePath + extraPath + "\\" + theFileName);
//myFile.Close();
}
catch (Exception e)
{
debugMessage("There was a problem receiving the package. The package file was opened by an application that won't share.");
}
// MessageBox.Show(theFileName);
//MessageBox.Show(results);
resAr = results.Split("\n".ToCharArray());
string[] temp;
string[] temp2;
string file = "";
string args = "";
string notice = "";
string es="";
string message = "";
string title = System.DateTime.Now.ToShortDateString() + " " + System.DateTime.Now.ToShortTimeString();
string dnsName = System.Net.Dns.GetHostName().ToLower() ;
string cu = getCurrentUser().ToUpper().Replace("VeraciTek\\","").ToLower();
string[] cua = getCurrentUser().ToUpper().ToLower().Split('\\');
if (cua.Length > 1)
cu = cua[1];
bool foundMe = false;
bool isMeViaMachineName = false;
for (int i=0;i<resAr.Length && isMe;i++)
{
//MessageBox.Show(resAr[i]);
temp = resAr[i].Split("=".ToCharArray());
//MessageBox.Show(temp.Length + "");
if (temp.Length > 1)
{
if (temp[0].ToLower().Trim() == "users")
if (temp[1].ToLower().Trim() != "all" && temp[1].ToLower().Trim() != "allservers")
{
//MessageBox.Show(temp[0] +"-"+ temp[1]);
temp2 = temp[1].Split(",".ToCharArray());
for (int b=0;b<temp2.Length && !foundMe;b++)
if (temp2[b].ToLower().Trim() == dnsName || temp2[b].ToLower().Trim() == cu)
{
if (temp2[b].ToLower().Trim() == dnsName)
isMeViaMachineName = true;
foundMe = true;
}
if (!foundMe)
isMe = false;
}
else
{
//MessageBox.Show("gotit");
isMe = false;
if (temp[1].ToLower().Trim() == "all")
if (!isserver(System.Environment.MachineName))
{
isMe = true;
isMeViaMachineName = true;
}
if (temp[1].ToLower().Trim() == "allservers")
if (isserver(System.Environment.MachineName))
{
isMe = true;
isMeViaMachineName = true;
}
}
if (temp[0].ToLower().Trim() == "file")
{
file = temp[1].Trim();
for (int c=2;c < temp.Length; c++)
file += "=" + temp[c];
}
if (temp[0].ToLower().Trim() == "arguments")
args = temp[1].Trim();
if (temp[0].ToLower().Trim() == "notice")
notice = temp[1].Trim();
if (temp[0].ToLower().Trim() == "kill")
if (temp[1].Trim().ToLower() == "true")
kill = true;
if (temp[0].ToLower().Trim() == "message")
{
//.........这里部分代码省略.........