Commit 184df7d5 张东亮

不限制一个软件打开

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