我的winform上有WebBrowser控件.当我尝试导航到某个网站时,我得到标准的IE错误页面,如:
我需要处理这些错误并将自定义错误消息返回给用户.有什么方法可以解决这个问题吗?
我在我的项目中使用log4net,有一个问题.该程序的主要功能需要很长时间,我使用日志记录来保存有关它的信息.我使用FileAppender将日志保存到文件.
我的应用程序位于共享(本地)文件夹中,可能有多个应用程序实例从一个路径运行.在这种情况下,我只能从第一个程序记录信息,我的应用程序的其他实例无法记录信息,因为日志文件已被锁定.
当我使用"log4net.Appender.FileAppender + MinimalLock"选项时,会出现信息丢失的情况.并非所有来自两个实例的日志都保存到文件中.
如何从并行实例中解决此问题和日志信息?当我使用"MinimalLock"选项时性能下降呢?
谢谢.希望得到你的帮助.
我们正在开发SPA - 完整的客户端基础javascript应用程序,需要对用户进行身份验证才能访问内部.
正如我从搜索中发现的那样,我们可以将我们的身份验证机制外包并使用Google帐户.我从这个网站上了解到 https://developers.google.com/accounts/docs/OAuth2Login - 如何处理Google API和身份验证机制.
简而言之,我们需要:
这个描述得很好,我理解它并有一些JS代码来实现它.
我不明白.
我有一个应用程序与它的私人数据.我想使用用户的电子邮件作为登录或用户ID(无论如何调用它)来访问应用程序的内部,例如用户创建的任务,用户的配置文件等.因此,在我的SPA中显示用户创建的任务我需要用户的电子邮件查询数据库.
我想象下一个场景:
Login with Google
按钮Logout
我们清除所有访问数据我应该在哪里坚持这些数据?
如果Forms Authentication
我理解我们将登录/密码传递给服务器,如果它们与数据库匹配,我们创建Forms Ticket
并将其存储在cookie中.
谷歌的身份验证是否有类似的案例?如果我将用户的电子邮件存储在cookie中,我认为出于安全原因这不是很好.如果我要保存令牌 - 我不确定为什么需要它以及如何在我的SPA中使用它,我在身份验证后没有使用任何Google API.
您是否有任何示例案例我们如何在类似案例中构建我们的流程?
谢谢.
authentication oauth-2.0 single-page-application google-oauth
我在下一种情况下有代码重复问题.在我的页面上,我需要通过点击链接显示/隐藏很多块:
<div>
<a data-bind="click: showHiddenFirst, visible: isVisibleFirst"href="#">Show first</a>
<div data-bind="visible: !isVisibleFirst()" style="display:none">
hidden content first
</div>
</div>
<div>
<a data-bind="click: showHiddenSecond, visible: isVisibleSecond"href="#">Show second</a>
<div data-bind="visible: !isVisibleSecond()" style="display:none">
hidden content second
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
而我的JS
var vm = function(){
this.isVisibleFirst = ko.observable(true);
this.showHiddenFirst = function(){
this.isVisibleFirst(false)
};
this.isVisibleSecond = ko.observable(true);
this.showHiddenSecond = function(){
this.isVisibleSecond(false)
};
};
ko.applyBindings(new vm());
Run Code Online (Sandbox Code Playgroud)
这是jsfiddle示例http://jsfiddle.net/sstude/brCT9/2/
问题是如何避免所有这些显示/可见重复?也许我需要一些自定义绑定,我把我的隐藏块或smth的id.其他?您可以建议的任何模式?
我有一些带有下一个标记的纯文本文件(.xls 扩展名)(附在下面)。它在 excel 2003 中打开,没有任何错误。
现在我需要知道什么是技术名称,什么时候可以通过html标记创建excel文件?
因为我需要修复此文件才能在 Excel 2007 及更早版本中正确打开。(我现在看到“不同格式的文件”错误)。
<html xmlns:o=\"urn:schemas-microsoft-com:office:office\\ xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel">
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Sheet1</x:Name>
<x:WorksheetOptions>
<x:Selected/>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:ProtectStructure>False</x:ProtectStructure>
<x:ProtectWindows>False</x:ProtectWindows>
</x:ExcelWorkbook>
</xml><![endif]-->
<style>
<!--table
{mso-displayed-decimal-separator:"\.";
mso-displayed-thousand-separator:" ";}
.xl2
{
mso-number-format:M/D/YY;
border-left:.5pt solid;
border-top:.5pt solid;
border-right:.5pt solid;
border-bottom:.5pt solid;
}
.xl3
{
border-left:.5pt solid;
border-top:.5pt solid;
border-right:.5pt solid;
border-bottom:.5pt solid;
}
-->
</style>
</head>
<body>
<table>
<tr> …
Run Code Online (Sandbox Code Playgroud) 我有一个复杂的对象,我试图伪造.
interface IContext
{
User User { get; }
}
A.CallTo(
() => _fakeContext.User.Subscription.Attributes)
.Returns(new List<Attribute>());
Run Code Online (Sandbox Code Playgroud)
但我得到了下一个例外:
The current proxy generator can not intercept the specified method for the following reasons: - Non virtual methods can not be intercepted
所有嵌套类型都是属性,它们是具有get; set;
属性修饰符的简单贫血类型.当我调查调试器时,他们都是假的.
有没有办法设置链的最后一个属性,避免设置以前的所有属性?
我想从WebServer得到一些回复.
返回的数据如下所示:
[[3014887,"string1 string","http://num60.webservice.com/u3014887/b_c9c0625b.jpg",0],
[3061529,"string2 string","http://num879.webservice.com/u3061529/b_320d6d36.jpg",0],
[7317649,"string3 string","http://num1233.webservice.com/u7317649/b_a60b3dc2.jpg",0],
[12851194,"string4 string","http://num843.webservice.com/u12851194/b_4e273fa4.jpg",0],
[15819606,"string5 string","http://num9782.webservice.com/u15819606/b_66333a8f.jpg",0],
[15947248,"string6 string","http://num1500.webservice.com/u15947248/b_920c8b64.jpg",0]]
Run Code Online (Sandbox Code Playgroud)
我认为是JSON
格式,但我无法在我的.Net WinForm应用程序中解析它.你能提供一些建议或说明如何做到这一点.
我搜索了JSON.NET
库,DataContractJsonSerializer
类,但我无法理解如何将它与响应的数据类型粘合在一起......
我为我的应用程序创建了 Visual Studio 2005 安装项目。Windows Installer 在安装过程中将一个 xml 文件放入 AppData/ myCustomFolder。我使用文件系统编辑器并添加了特殊文件夹 - 用户的应用程序数据文件夹,然后在那里包含该 xml。
当我从 Program Files 中的 Control Panel 文件夹中卸载应用程序时,我的 xml 文件也从 AppData 中删除了。即使用户重新安装应用程序,我也需要始终将此 xml 文件保留在 AppData 中。
我怎么能做到?
我有下一个实体:
public class Topic : EntityBase
{
private readonly ICollection<Vote> _votes;
public virtual string Title { get; protected set; }
public virtual ICollection<Vote> Votes
{
get { return _votes; }
}
public virtual int VotedUpCount
{
get
{
return _votes.Count(v => v.VotedTo == VoteType.VoteUp);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我需要映射我VotedUpCount
(因为我有来自NH的错误).但我不需要此属性作为我的数据库中的列.
我试过这个并且出错了 Invalid column name 'VotedUpCount'.
public class TopicMap : ClassMap<Topic>
{
public TopicMap()
{
Id(x => x.Id);
Map(x => x.Title);
Map(x => x.VotedUpCount).Access.ReadOnly();
HasMany<Vote>(x => x.Votes)
.Cascade.All();
} …
Run Code Online (Sandbox Code Playgroud) 有点问题。我有一份执行很长时间的报告。一小时过去后,会出现“无法显示页面”错误。我认为这很重要。带有超时设置。
此设置已增加:
C:\Program Files\Microsoft SQL Server\MSSQL.2\ReportingServices\ReportManager\Web.config C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\Web.config
<httpRuntime executionTimeout=" 18000 "/>
C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\rsreportserver.config
<Add Key="SQLCommandTimeoutSeconds" Value=" 18000 "/>
<Add Key="MaxActiveReqForOneUser" Value="20"/>
<Add Key="DatabaseQueryTimeout" Value=" 18000 " />
还有:
报表管理器->站点设置->报表执行超时->选择“不超时报表执行”。
更改并没有解决我的问题。
可能有什么。在 IIS 配置中?我应该增加任何其他超时设置吗?
希望得到您的帮助。谢谢。
.net ×2
c# ×2
dry ×1
excel ×1
fakeiteasy ×1
fileappender ×1
google-oauth ×1
html ×1
javascript ×1
json ×1
knockout.js ×1
log4net ×1
logging ×1
mocking ×1
nhibernate ×1
oauth-2.0 ×1
readonly ×1
unit-testing ×1
winforms ×1
xml ×1