我们如何通过按Ctrl+ Shift+ 来保存Visual Studio代码中的所有文件,就像我们在Visual Studio中一样S?
我使用角度2 RC 4和*ngIf不工作这里是视图的代码
视图
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand"> </span>
</div>
<div class="navbar-collapse">
<ul class="nav navbar-nav">
<li><a [routerLink]="['/Home']">Home</a>
<span style="color:red">{{auth.isAdmin}}</span>
<span style="color:red">{{auth.isLoggedIn}}</span>
</li>
<li *ngIf="auth.isLoggedIn && auth.isAdmin"><a [routerLink]="['/Category']">Category</a></li>
<li *ngIf="auth.isLoggedIn && auth.isAdmin"><a [routerLink]="['/Products']">Product</a></li>
<li *ngIf="auth.isLoggedIn && !auth.isAdmin"><a [routerLink]="['/BuyProduct']">Buy Products</a></li>
<li *ngIf="auth.isLoggedIn && !auth.isAdmin"><a [routerLink]="['/Cart']"><i class="fa fa-shopping-cart"></i><span class="badge" >11</span></a></li>
<!--<li *ngIf="isLoggedIn"><a [routerLink]="['/Folder']"><i class="fa fa-shopping-cart"></i><span class="badge" >Folder</span></a></li>-->
</ul>
<ul class="nav navbar-nav navbar-right" *ngIf="!auth.isLoggedIn"> …Run Code Online (Sandbox Code Playgroud) 在第一个局部视图中我有搜索功能,当用户点击搜索时我想将结果刷新到第三个局部视图.
控制器:
public ActionResult Search()
{
virtualmodel vm = new virtualmodel();
return PartialView(svm);
}
[HttpPost]
public ActionResult Search(ViewModel svm)
{
// Query to retrive the result
// I am not sure what to return from here. Link to another action or just return back to same same partial
}
public ActionResult AnotherPartialPartial()
{
}
Run Code Online (Sandbox Code Playgroud)
在主要观点
@{Html.RenderAction("Search", "Searchc");
}
Run Code Online (Sandbox Code Playgroud)
怎么做?我需要ajax吗?
当试图从Hitbox API获取数据时,我得到一个奇怪的结果.对于一个API的命令,它每次都会发生,有时只发生在另一个API上.结果或多或少那样(这是我得到的最后一个结果):
\ u001f\B\0\0\0\0\0\0\U0003 콋 w8sΜmu〜SNT&Ng6C Ͷ$ z%9igf [( \u0005 \u000f (: 6 \u000f \bP C\ u0015 \n \u007f V \u007f d h2_&nj,呎\ u00177\u0019 <N〜YoVY\u0018M> SKP | ^ w9w2 \u06054Ƿ&\u0015ƛXo\ u0014 [二\ u0011onVP\u0005e\u000e \u05ca l/ ⇝ % u u s =
w??z\u0003?a????SR,???s?1????????2~.6\u0006T>??fR??l?(???\u0017?GHoV?&/?m#?'\u0013?C?N/??E|Q?\u0012???3+?6\u0003z\u0012???q>?{?_??eW?7\u0016?rsIw\u0012\u0018&\u0017??V?\u000f??\u001f??????e?\u0002A??Zg??U\u0006??\\g\u0015?VP??u.E8Hj?k LA /͋ | ; xk\u001e ǣZ \3y \u00019 \u0017 ī\u0002 u O] v XA { \u0004 K lo\u0016 %吨\ u0006 <{O =\u0017\u0017\u0015%$ G \"Oϡ\ u007f ^̹hHq8\ u00016\u0015y {??S??4+?pb-\\eI?bB]^\u001f { jՊx \u0004 \u0001 º QD \u001eK\u0001;\u0002 …
我在Visual Studio代码中运行任务时遇到此问题.这是屏幕截图供参考.
这是tasks.json的代码
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"args": ["-p", "."],
"showOutput": "always",
"problemMatcher": "$tsc"
}
Run Code Online (Sandbox Code Playgroud)
和tsconfig.json的代码
{
"compilerOptions": {
"noImplicitAny": true,
"noEmitOnError": true,
"sourceMap": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"target": "es5",
"module": "commonjs",
"moduleResolution": "node"
},
"exclude": [
"node_modules",
"wwwroot",
"typings"
],
"compileOnSave": true
}
Run Code Online (Sandbox Code Playgroud)
和systemjs.config.js的代码
/**
* System configuration for Angular 2 samples
* Adjust as necessary for your …Run Code Online (Sandbox Code Playgroud) 如何根据一个输入的最大长度在我的单元格上设置自动调整大小.
using (rng = workSheet.Cells["A1:G1"])
{
rng.Style.Font.Bold = true;
rng.Style.Fill.PatternType = ExcelFillStyle.Solid;
rng.Style.Fill.BackgroundColor.SetColor(Color.DarkBlue);
rng.Style.Font.Color.SetColor(Color.White);
}
using (ExcelRange col = workSheet.Cells[2, 6, 7, 7])
{
col.Style.Numberformat.Format = "yyyy-mm-dd HH:mm";
col.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right;
}
for (int i = 1; i <= a; i++)
{
workSheet.Cells["A1"].Value = "RU_ID";
workSheet.Cells["B1"].Value = "COR_REQ_ID";
workSheet.Cells["C1"].Value = "RU_NAME";
workSheet.Cells["D1"].Value = "PARENT_RU_NAME";
workSheet.Cells["E1"].Value = "ADJUSTMENT_STATE";
workSheet.Cells["F1"].Value = "COR_START";
workSheet.Cells["G1"].Value = "COR_END";
}
...
rng.AutoFitColumns();
string path = @"D:\excel\test.xlsx";
Stream stream = File.Create(path);
excel.SaveAs(stream);
stream.Close();
byte[] data = File.ReadAllBytes(path); …Run Code Online (Sandbox Code Playgroud) 如何识别计算机上安装的Polymer-cli版本?
我的意思是说当我们想知道我们做的npm-cli和bower-cli等版本时
npm -v
bower -v
gulp -v
是否有任何命令或什么来获得聚合物-cli版本
我有两个配置文件,旧版本和最新版本.我需要更新旧的,所以我制作了以下代码来打开它们并将键/值加载到两个字典中,我将在稍后进行比较.代码如下:需要改变什么?
public void UpdateCliente(string FilePathOld, string FilePathNew)
{
Dictionary<string, string> Old = new Dictionary<string, string>();
Dictionary<string, string> New = new Dictionary<string, string>();
List<string> KeysOld = new List<string>();
List<string> KeysNew = new List<string>();
//Keys = ConfigurationSettings.AppSettings.AllKeys.ToList();
ExeConfigurationFileMap configMap = new ExeConfigurationFileMap();
configMap.ExeConfigFilename = FilePathOld;
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.None);
KeysOld = config.AppSettings.Settings.AllKeys.ToList();
Old = (config.GetSection("<appSettings>") as System.Collections.Hashtable)
.Cast<System.Collections.DictionaryEntry>()
.ToDictionary(n => n.Key.ToString(), n => n.Value.ToString());
//Old = (config.GetSection("<appSettings>") as System.Collections.Hashtable)
}
Run Code Online (Sandbox Code Playgroud)
这一行: Old = (config.GetSection("<appSettings>") as System.Collections.Hashtable)给我以下错误:
无法通过引用转换,装箱转换,拆箱转换,换行转换或空类型转换将类型'System.Configuration.ConfigurationSection'转换为'System.Collections.Hashtable'
注意:我忘记了转换新文件的密钥的代码,但方法应该是相同的!
我正在尝试使用SQL INSERT INTO将刚刚上传的img源插入数据库.
这是我得到的线:
"在SQL语句结束时缺少分号(;)."
错误.
command.CommandText = "INSERT INTO users (pic) VALUES (Images/"+fileName+") WHERE id="+theId;
Run Code Online (Sandbox Code Playgroud)
这是整个.aspx.cs文件:
using System;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Collections.Generic;
public partial class CS : System.Web.UI.Page
{
protected void Upload(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Images/") + fileName);
string theId = Request.Cookies["Logged"].Value;
System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection();
connection.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Etay\Documents\Visual Studio 2012\WebSites\Josef\Shared\users.mdb";
try
{
System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand();
command.Connection = connection; …Run Code Online (Sandbox Code Playgroud)