假设我有一个List<T>成员班.假设我不确定将推送多少项(但我不想将其作为阻止列表) - 此列表包含过去24小时内项目的滑动窗口(我使用LINQ查询访问它) ).
是否有一种简洁的方法告诉列表将自己序列化为某个磁盘文件以避免内存不足并在项目从列表中再次删除时自行化?(文件流或其他东西)
或者我是否需要自己编写机制?
试图在MVC4(+ Razor)中实现一个表单,但是提交按钮没有做任何事情.
控制器(应该获得后期操作):
public class GeneralController
{
[HttpPost]
public ActionResult SearchResults(SearchParamsModel searchParams)
{
// doin some stuff here
return View("SearchResultsView");
}
}
Run Code Online (Sandbox Code Playgroud)
查看(.cshtml)
@model Models.SearchParamsModel
@using (Html.BeginForm("SearchResults", "General", FormMethod.Post))
{
<section class="form-field">
<input type="text" name="Property1" id="Property1" class="field field139 autocomplete-init-no-img" />
<label for="Property1">value1</label>
<form action="" method="post" class="clearfix">
<input type="submit" value="some value" class="submit btn blue-btn special-submit" />
</form>
</section>
}
Run Code Online (Sandbox Code Playgroud)
模型
public class SearchParamsModel
{
public string Property1{ get; set; }
}
Run Code Online (Sandbox Code Playgroud) 好吧,经过长时间的调查,似乎当我有一个创建的视图与_layout.cshtml一起工作时 - 我所拥有的表格中的提交按钮不起作用(没有动作返回给控制器).
只有当我创建一个视图并取消选中"使用布局或母版页"时 - 该按钮才有效!
这看起来非常不清楚,所以 - 如何使用一般的_layout.cshtml和一个工作表单按钮同时查看?
下面:尝试在MVC4(+ Razor)中实现一个表单
控制器(应该获得后期操作):
public class GeneralController {
[HttpPost]
public ActionResult SearchResults(SearchParamsModel searchParams)
{
// doin some stuff here
return View("SearchResultsView");
}
}
Run Code Online (Sandbox Code Playgroud)
查看(.cshtml)
@model Models.SearchParamsModel
@using (Html.BeginForm("SearchResults", "General", FormMethod.Post))
{
<section class="form-field">
<input type="text" name="Property1" id="Property1" class="field field139 autocomplete-init-no-img" />
<label for="Property1">value1</label>
<form action="" method="post" class="clearfix">
<input
type="submit"
value="some value"
class="submit btn blue-btn special-submit" />
</form>
</section>
}
Run Code Online (Sandbox Code Playgroud)
模型
public class SearchParamsModel
{
public string Property1{ get; …Run Code Online (Sandbox Code Playgroud) 完整的日历 - 有没有办法设置小部件的"着陆时间"?目前第一个可见小时是06:00 - 如果我想要看到第一个小时-15:00 - 但我不会失去前几个小时(用户仍然可以向上滚动并看到它们) - 但是最重要的数据通常是从15:00开始......这可以实现吗?
如何判断"sanitize-html"实际删除html标签(仅保留其中的内容)?目前,如果我将它设置为保留div部分,在输出中它也写入<div>some content</div>- 我只想要内部...('一些内容')
简而言之 - 我不想要标签,属性等 - 只有那些元素的内容..
var Crawler = require("js-crawler");
var download = require("url-download");
var sanitizeHtml = require('sanitize-html');
var util = require('util');
var fs = require('fs');
new Crawler().configure({depth: 1})
.crawl("http://www.cnn.com", function onSuccess(page) {
var clean = sanitizeHtml(page.body,{
allowedTags: [ 'p', 'em', 'strong','div' ],
});
console.log(clean);
fs.writeFile('sanitized.txt', clean, function (err) {
if (err) throw err;
console.log('It\'s saved! in same location.');
});
console.log(util.inspect(clean, {showHidden: false, depth: null}));
var str = JSON.stringify(clean.toString());
console.log(str);
/*download(page.url, './download')
.on('close', function …Run Code Online (Sandbox Code Playgroud) 我在预构建步骤中编译另一个需要时间的项目 - 在控制台中看不到任何输出我只是在等待.有没有办法将它输出到控制台?
我有这个简单的代码:
public void CreateCounters() {
if (PerformanceCounterCategory.Exists(_categoryName)) {
PerformanceCounterCategory.Delete(_categoryName);
}
// create logic…
}
Run Code Online (Sandbox Code Playgroud)
适用于我的机器.我在我的服务器上运行它,得到以下堆栈跟踪:
System has detected a fatal error. EXITING...
NativeErrorCode: 1010
ErrorCode: -2147467259
Message: The configuration registry key is invalid
TargetSite: Void RegisterFiles(System.String, Boolean)
HelpLink:
Source: System
Stack Trace:
at System.Diagnostics.PerformanceCounterLib.RegisterFiles(String arg0, Boolean unregister)
at System.Diagnostics.PerformanceCounterCategory.Delete(String categoryName)
at myApp.Common.Utils.PerformanceCounters.PerformanceCounters.CreateCounters()
at myApp.Common.Utils.PerformanceCounters.myAppPerformanceCounterReporter.Init()
at myApp.Common.Utils.PerformanceCounters.myAppPerformanceCounterReporter.get_Instance()
at myApp.Program.Main(String[] args)
Run Code Online (Sandbox Code Playgroud)
该类别存在于服务器上,我可以在perfmonGUI中看到它.
在以下示例中,可以“隐藏” Y轴值-例如-不显示0和200(在左侧)。寻找更清洁的图表。
I implement wix to generate some msi. I'd like to maintain .bat file (that is packed within this wix project) to contain some work to do (and to be activated with some custom action) I added the .bet to my wix project in VS2010.
My question is
这是我的情况:
我有 VS2010 解决方案,其中包含 X 项目。
Wix 项目可以从所有编译的工件创建 msi。
我有构建机器\ Jenkins,首先编译(MSBuild .Net 4)所有解决方案,然后编译wix以将其打包到msi。
我如何将产品编号(例如 11.2.0.4789)注入到所有工件\dll中 - 尽可能简单?
编译解决方案时是否可以传递命令行参数?
c# ×2
wix ×2
console ×1
controller ×1
filestream ×1
forms ×1
fullcalendar ×1
gauge ×1
highcharts ×1
jenkins ×1
jquery ×1
linq ×1
list ×1
msbuild ×1
node.js ×1
perfmon ×1
post ×1
submit ×1
versioning ×1
wix3.5 ×1