在互联网上有许多类似的问题,包括SO,但提议的解决方案在我的情况下不起作用.场景:xaml中有一个日志文本框
<TextBox Name="Status"
Margin="5"
Grid.Column="1"
Grid.Row="5"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Width="600"
Height="310"/>
Run Code Online (Sandbox Code Playgroud)
在代码隐藏中有一些方法可以做一些工作并在这个文本框中添加一些多行(可能就是问题?)消息:
private static void DoSomeThings(TextBox textBox)
{
// do work
textBox.AppendText("Work finished\r\n"); // better way than Text += according to msdn
// do more
textBox.AppendText("One more message\r\n");
...
}
private static void DoSomething2(TextBox textBox)
{
// same as first method
}
Run Code Online (Sandbox Code Playgroud)
执行所有操作后,需要滚动到文本框的底部.尝试ScrollToEnd(),ScrollToLine,将文本框包装到ScrollViewer,Selection和Caret解决方法,将ScrollToEnd附加到TextChanged.在溢出文本框高度的执行行仍然需要手动滚动之后,这些都不起作用.对不起重复的问题,我想我错过了一些小问题,可以由对问题有新见解的人迅速解决.提前致谢.
我有一个ASP.NET Web表单应用程序,使用.Net Connector for MySql Entity Framework.
我以前使用MySql创建了一个Web应用程序,但从未遇到过这个问题.
我目前每天获得大约20000次页面浏览量,并且每天大约有10次"嵌套交易"错误不受支持.
我无法弄清楚它为什么会发生,为什么它只会偶尔发生一次.
在主页面预加载事件中,我获得用户的整数ID并将其保存到公共变量:
using (var entity = new Entities())
{
var user = entity.my_aspnet_users.Single(i => i.name == Context.User.Identity.Name);
UserID = user.id;
if (HttpContext.Current.Request.Url.AbsolutePath != "###" && HttpContext.Current.Request.Url.AbsolutePath != "###")
{
if (user.Player == null)
Response.Redirect("###", true);
else
PlayerID = user.Player.PlayerID;
}
}
Run Code Online (Sandbox Code Playgroud)
然后在页面上:
using (var entity = new Entities())
if (entity.Players.Count(i => ###) == 1)
{
var user = entity.my_aspnet_users.Single(i => i.id == Master.UserID);
if (user.Player == null)
{
user.Player = entity.Players.Single(i …Run Code Online (Sandbox Code Playgroud) 如何在LARAVEL的foreach条目后添加一个数字请帮忙?我想做的是在做饭之后