Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
SO1131-XLRStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 184df7d5
由
张东亮
编写于
2025-09-04 18:07:20 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
不限制一个软件打开
1 个父辈
178f52e4
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
32 行增加
和
31 行删除
source/Common/util/MyWebClient.cs
source/ShelfPrinter/FrmShelfPrinterMain.cs
source/ShelfPrinter/Program.cs
source/Common/util/MyWebClient.cs
查看文件 @
184df7d
...
...
@@ -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
();
...
...
source/ShelfPrinter/FrmShelfPrinterMain.cs
查看文件 @
184df7d
...
...
@@ -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
;
...
...
source/ShelfPrinter/Program.cs
查看文件 @
184df7d
...
...
@@ -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!
Cancel
请
注册
或
登录
后发表评论