我有3台服务器,所有服务器都运行Windows Web Server,.NET 4和IIS7.我的web.config文件的开头部分是:
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, …
Run Code Online (Sandbox Code Playgroud) 我想设置Git全局忽略某些文件.
我已经.gitignore
在我的用户根目录(/Users/me/
)中添加了一个文件,并在其中添加了以下行:
*.tmproj
Run Code Online (Sandbox Code Playgroud)
但它并没有忽略这种类型的文件,任何想法我做错了什么?
我想在我的页面上包含一个功能,用于检查用户是否在其电子邮件中有Gravatar帐户.如果是,他们应该显示该图片,如果没有,他们应该给予其他选择.
我正在尝试按如下方式执行此操作:
$.ajax({
url: 'https://secure.gravatar.com/' + md5(user.email) + '.json',
method: 'GET',
timeout: 4000,
success: function successFn() {
doGravatarStuff();
},
error: function errorFn(response, status, error) {
console.log(response.status); //debug
}
});
Run Code Online (Sandbox Code Playgroud)
这总是在Internet Explorer上返回错误状态0,我似乎无法弄清楚原因.我尝试将'dataType'更改为'json','html'等,但这似乎没有帮助.
此外,也许这是一个相关的问题,如果我在FF或Crome上测试这个问题,并且用户确实没有帐户,则会根据"网络"标签读取返回404错误
404 Not Found 649ms
Run Code Online (Sandbox Code Playgroud)
但'response.status'似乎仍为0
任何人的想法?非常感谢提前!!
我在我们的一个网站上遇到了一个问题:
在IE9中,页面有一个垂直滚动条,但你不能使用鼠标滚轮,箭头键,pgup/pgdwn来滚动.滚动的唯一方法是实际单击/按住并移动滚动条.
我从css中删除了以下内容:
{
overflow-x: hidden;
}
Run Code Online (Sandbox Code Playgroud)
然后滚动照常工作.还有其他人遇到过这个吗?溢出-x应该隐藏水平滚动条似乎很奇怪?它为什么会影响垂直?
我在测试页面上尝试了这个,它按预期运行.所以它必须是事物的组合.
我正在使用cerr流进行错误输出,但我还想将这个错误输出保存在内存中的字符串流中.
我想转此:
stringstream errorString;
cerr << " Something went wrong ";
errorString << " Something went wrong ";
Run Code Online (Sandbox Code Playgroud)
成
myErr << " Something went wrong ";
Run Code Online (Sandbox Code Playgroud)
其中myErr是一个类的实例,它将其存储在字符串流中并输出到cerr.
谢谢你的帮助.
嗨,我想在Android的EditText键盘上只显示数字和字符,我确实尝试添加属性,android:inputType = text|number
但它不起作用.
请帮助我提出任何其他更好的建议.提前致谢.
我读了一本关于SQLServer 2008的书.在这本书中,作者说尽管存储过程主要是解决方案,但你应该避免一直使用它们.
我知道存储过程是预编译的,因此它们比正常命令运行得更快.另外,因为它们使用参数来传递数据,所以在SQL注入攻击的情况下,它们比普通的SQL命令更安全.
所以我不明白的是:为什么不总是使用存储过程?
我的配置中有一个记录器,如下所示:
resources.log.stream.writerName = "Stream"
resources.log.stream.writerParams.stream = APPLICATION_PATH "/../logs/err.log"
resources.log.stream.writerParams.mode = "a"
resources.log.stream.filterName = "Priority"
resources.log.stream.filterParams.priority = 3
Run Code Online (Sandbox Code Playgroud)
但我想将它用于错误日志.对于另一个日志想要使用另一个日志文件.出于这个原因,我将这些行添加到app.ini
resources.log.stream.writerName = "Stream"
resources.log.stream.writerParams.stream[] = APPLICATION_PATH "/../logs/debug.log"
resources.log.stream.writerParams.stream[] = APPLICATION_PATH "/../logs/info.log"
resources.log.stream.writerParams.mode = "a"
resources.log.stream.filterName = "Priority"
resources.log.stream.filterParams.priority[] = 7
resources.log.stream.filterParams.priority[] = 5
Run Code Online (Sandbox Code Playgroud)
但这不起作用我想使用differetn文件的不同优先级.但是记录器会覆盖第一个记录器.怎么样 ?
在我的WPF应用程序中,我特别Window
包含其中一个控件DocumentViewer
.
打开并加载此窗口时,它会动态构建FixedDocument
带有进度指示器的窗口,然后将其显示在DocumentViewer
.它工作,并为了改善用户体验,我在自己的线程中运行此窗口,以便在构建文档时主应用程序窗口仍然响应.
基于此网页上的提示,我在一个新的线程中打开我的窗口,如下所示:
public void ShowDocumentViewerWindow(params object[] data) {
var thread = new Thread(() => {
var window = new MyDocumentViewerWindow(new MyObject(data));
window.Closed += (s, a) => window.Dispatcher.InvokeShutdown();
window.Show();
System.Windows.Threading.Dispatcher.Run();
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
}
Run Code Online (Sandbox Code Playgroud)
到目前为止,我对这个设置很满意,但我刚遇到了一个问题.
MyDocumentViewerWindow
包含一个打印按钮,它引用内置的Print命令,以DocumentViewer为目标:
<Button Command="Print" CommandTarget="{Binding ElementName=MyDocumentViewer}">Print</Button>
Run Code Online (Sandbox Code Playgroud)
在我把窗口放在自己的线程之前,这很好用.但现在,当我点击它时,应用程序崩溃了.Visual Studio 2010将上面代码中的以下行突出显示为崩溃位置,并显示消息' 调用线程无法访问此对象,因为另一个线程拥有它.":
System.Windows.Threading.Dispatcher.Run();
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪如下所示:
at System.Windows.Threading.Dispatcher.VerifyAccess()
at MS.Internal.Printing.Win32PrintDialog.ShowDialog()
at System.Windows.Controls.PrintDialog.ShowDialog()
at System.Printing.PrintQueue.GatherDataFromPrintDialog(PrintDialog printDialog, XpsDocumentWriter&amp; writer, PrintTicket&amp; partialTrustPrintTicket, PrintQueue&amp; partialTrustPrintQueue, Double&amp; width, Double&amp; height, String jobDescription)
at …
Run Code Online (Sandbox Code Playgroud) 这是我的代码,它采用一些JSON数据并将其插入Core Data room实体:
for (NSDictionary *room in rooms)
{
NSDictionary *thisroom = [room objectForKey:@"room"];
NSString *roomidstring = [thisroom objectForKey:@"roomid"];
int roomid = [roomidstring intValue];
NSString *roomname = [thisroom objectForKey:@"roomname"];
NSString *buildingidstring = [thisroom objectForKey:@"buildingid"];
int buildingid = [buildingidstring intValue];
// import into database
NSManagedObject *roomInfo = [NSEntityDescription insertNewObjectForEntityForName:@"room" inManagedObjectContext:context];
[roomInfo setValue:[NSNumber numberWithInteger:roomid] forKey:@"roomid"];
[roomInfo setValue:roomname forKey:@"roomname"];
[roomInfo setValue:[NSNumber numberWithInteger:buildingid] forKey:@"buildingid"];
if (![context save:&error]) {
NSLog(@"Whoops, couldn't save: %@", [error localizedDescription]);
}
}
Run Code Online (Sandbox Code Playgroud)
插入约900个物体时速度极慢.有没有办法让这个更高效和/或加快速度?
谢谢!