Commit 184df7d5 张东亮

不限制一个软件打开

1 个父辈 178f52e4
...@@ -223,7 +223,7 @@ namespace OnlineStore.Common ...@@ -223,7 +223,7 @@ namespace OnlineStore.Common
try try
{ {
LogUtil.debug( "HTTP GET FROM: " + url); LogUtil.debug( "HTTP GET FROM: " + url);
using (var wc = new WebClient { Encoding = encoding }) using (var wc = new MyWebClient { Encoding = encoding,Timeout=5000 })
{ {
var readStream = wc.OpenRead(url); var readStream = wc.OpenRead(url);
using (var sr = new StreamReader(readStream, encoding)) using (var sr = new StreamReader(readStream, encoding))
......
...@@ -23,6 +23,7 @@ namespace ShelfPrinter ...@@ -23,6 +23,7 @@ namespace ShelfPrinter
{ {
CheckForIllegalCrossThreadCalls = false; CheckForIllegalCrossThreadCalls = false;
InitializeComponent(); InitializeComponent();
Text= ConfigAppSettings.GetValue(Setting_Init.App_Title, "料架打印");
PrintLabel.Common.MULTIPLE = 100f; PrintLabel.Common.MULTIPLE = 100f;
print = new Asa.PrintLabel(Application.StartupPath + "\\Label"); print = new Asa.PrintLabel(Application.StartupPath + "\\Label");
print.PrintStatusChanged += Print_PrintStatusChanged; print.PrintStatusChanged += Print_PrintStatusChanged;
......
...@@ -60,35 +60,35 @@ namespace ShelfPrinter ...@@ -60,35 +60,35 @@ namespace ShelfPrinter
// 该程序已经运行, // 该程序已经运行,
bool isShow = false; bool isShow = false;
if (processcollection.Length >= 1) //if (processcollection.Length >= 1)
{ //{
foreach (Process process in processcollection) // foreach (Process process in processcollection)
{ // {
if (process.Id != currentproc.Id) // if (process.Id != currentproc.Id)
{ // {
// 如果进程的句柄为0,即代表没有找到该窗体,即该窗体隐藏的情况时 // // 如果进程的句柄为0,即代表没有找到该窗体,即该窗体隐藏的情况时
if (process.MainWindowHandle.ToInt32().Equals(0)) // if (process.MainWindowHandle.ToInt32().Equals(0))
{ // {
string formTitle = ConfigAppSettings.GetValue(Setting_Init.App_Title); // string formTitle = ConfigAppSettings.GetValue(Setting_Init.App_Title,"料架打印");
// 获得窗体句柄 // // 获得窗体句柄
formhwnd = FindWindow(null, formTitle); // formhwnd = FindWindow(null, formTitle);
// 重新显示该窗体并切换到带入到前台 // // 重新显示该窗体并切换到带入到前台
ShowWindow(formhwnd, SW_RESTORE); // ShowWindow(formhwnd, SW_RESTORE);
SwitchToThisWindow(formhwnd, true); // SwitchToThisWindow(formhwnd, true);
isShow = true; // isShow = true;
break; // break;
} // }
else // else
{ // {
// 如果窗体没有隐藏,就直接切换到该窗体并带入到前台 // // 如果窗体没有隐藏,就直接切换到该窗体并带入到前台
// 因为窗体除了隐藏到托盘,还可以最小化 // // 因为窗体除了隐藏到托盘,还可以最小化
SwitchToThisWindow(process.MainWindowHandle, true); // SwitchToThisWindow(process.MainWindowHandle, true);
isShow = true; // isShow = true;
break; // break;
} // }
} // }
} // }
} //}
if (!isShow) if (!isShow)
{ {
LogUtil.info("启动程序"); LogUtil.info("启动程序");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!