Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-ACPackingStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 123aacbd
由
LN
编写于
2020-01-04 09:26:49 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
日志修改
1 个父辈
73363f32
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
29 行增加
和
12 行删除
source/ACPackingStore/FrmStore.cs
source/Common/util/LogUtil.cs
source/ACPackingStore/FrmStore.cs
查看文件 @
123aacb
...
@@ -57,7 +57,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -57,7 +57,7 @@ namespace OnlineStore.ACPackingStore
// LogUtil.logBox = this.logBox;
// LogUtil.logBox = this.logBox;
// HideForm();
// HideForm();
LoadOk
=
true
;
LoadOk
=
true
;
LogUtil
.
logBox
=
this
.
logBox
;
LogUtil
.
logBox
=
this
.
logBox
;
this
.
timer1
.
Start
();
this
.
timer1
.
Start
();
}
}
...
...
source/Common/util/LogUtil.cs
查看文件 @
123aacb
...
@@ -18,8 +18,7 @@ namespace OnlineStore.Common
...
@@ -18,8 +18,7 @@ namespace OnlineStore.Common
public
static
Dictionary
<
int
,
DateTime
>
lastErrorLogTime
=
new
Dictionary
<
int
,
DateTime
>();
public
static
Dictionary
<
int
,
DateTime
>
lastErrorLogTime
=
new
Dictionary
<
int
,
DateTime
>();
public
static
System
.
Windows
.
Forms
.
RichTextBox
logBox
=
null
;
public
static
System
.
Windows
.
Forms
.
RichTextBox
logBox
=
null
;
public
static
int
showCount
=
20
;
public
static
int
showCount
=
20
;
public
static
bool
debug_opened
=
false
;
public
static
bool
debug_opened
=
false
;
...
@@ -96,18 +95,28 @@ namespace OnlineStore.Common
...
@@ -96,18 +95,28 @@ namespace OnlineStore.Common
{
{
try
try
{
{
//if (logList.Count > 0)
//{
// logList.RemoveAt(0);
//}
//if (logList.Count >= showCount)
//{
// logList.RemoveAt(logList.Count - 1);
//}
//System.DateTime now = System.DateTime.Now;
//logList.Insert(0, now.ToLongTimeString() + " " + msg + Environment.NewLine);
//logList.Insert(0, Environment.NewLine);
if
(
logList
.
Count
>
0
)
if
(
logList
.
Count
>
0
)
{
{
logList
.
RemoveAt
(
0
);
//
logList.RemoveAt(0);
}
}
if
(
logList
.
Count
>=
showCount
)
if
(
logList
.
Count
>=
showCount
)
{
{
logList
.
RemoveAt
(
logList
.
Count
-
1
);
logList
.
RemoveAt
(
0
);
}
}
System
.
DateTime
now
=
System
.
DateTime
.
Now
;
logList
.
Insert
(
0
,
now
.
ToLongTimeString
()
+
" "
+
msg
+
Environment
.
NewLine
);
logList
.
Insert
(
0
,
Environment
.
NewLine
);
string
text
=
""
;
string
text
=
""
;
foreach
(
string
str
in
logList
)
foreach
(
string
str
in
logList
)
{
{
...
@@ -116,8 +125,16 @@ namespace OnlineStore.Common
...
@@ -116,8 +125,16 @@ namespace OnlineStore.Common
if
(
logBox
==
null
)
if
(
logBox
==
null
)
{
{
return
;
return
;
}
}
logBox
.
Text
=
text
;
logBox
.
Text
=
text
;
System
.
DateTime
now
=
System
.
DateTime
.
Now
;
logList
.
Add
(
now
.
ToLongTimeString
()
+
" "
+
msg
+
Environment
.
NewLine
);
// logBox.Focus(); //使文本框获取焦点
logBox
.
AppendText
(
now
.
ToLongTimeString
()
+
" "
+
msg
+
Environment
.
NewLine
);
//增加文本
logBox
.
Select
(
logBox
.
Text
.
Length
,
0
);
//设置光标的位置到文本尾
logBox
.
ScrollToCaret
();
//滚动到控件光标处
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论