我正在尝试将 blob 从一个目录复制到另一个目录中,然后从源中删除 blob。我已经尝试过下面的代码,但没有复制并粘贴到另一个文件夹中,但删除操作有效。
var cred = new StorageCredentials("storageName", "Key");
var account = new CloudStorageAccount(cred, true);
var client = account.CreateCloudBlobClient();
var container = client.GetContainerReference("containerName");
CloudBlockBlob sourceBlob = container.GetBlockBlobReference("folder/test.jpg");
//this doesn't work
sourceBlob.StartCopyAsync(new Uri("destination url"));
//this works
sourceBlob.DeleteAsync();
Run Code Online (Sandbox Code Playgroud) 我正在从 api 获取数据并希望显示在表格中,并且在表格中我有 # 列用于序列号现在我想显示到目前为止我已经完成的序列号但是当我在每一页上显示 1 到 10 个序列号时更改显示的页面 1- 10 下一页加载时从 1 开始计数
<tbody>
<tr *ngFor="let user of _data | paginate: { itemsPerPage: 10, currentPage: p }; let i=index">
<th>{{i + 1}}</th>
<th>{{user.FirstName}}</th>
<th>{{user.LastName}}</th>
<th>{{user.Email}}</th>
<th>
<button *ngIf="user.IsActive==false" class="btn btn-success btn-xs" (click)="changeStatus(user.Id)"> <i class="fa fa-check"></i> Active </button>
<button *ngIf="user.IsActive==true" class="btn btn-danger btn-xs" (click)="changeStatus(user.Id)"><i class="fa fa-trash-o"></i> Block</button>}}
</th>
</tr>
</tbody>Run Code Online (Sandbox Code Playgroud)
我正在尝试创建 asp.net 核心应用程序并使用 scaffold-dbcontext 生成类。当我运行这个应用程序时,它会向我显示错误。我已经按照相同的问题在 stackoverflow 上找到了一些答案,但我的仍然存在。题
public partial class MyContext: DbContext
{
public MyContext(DbContextOptions<MyContext> options) : base(options)
{
}
public virtual DbSet<Answer> Answer { get; set; }
public virtual DbSet<Attachment> Attachment { get; set; }
public virtual DbSet<Category> Category { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
optionsBuilder.UseSqlServer(@"Server=.;Database=MyContext;Trusted_Connection=True;");
}
protected override void OnModelCreating(ModelBuilder modelBuilder) { .... }
}
Run Code Online (Sandbox Code Playgroud)
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddMvc()
.AddJsonOptions(options =>
options.SerializerSettings.PreserveReferencesHandling = PreserveReferencesHandling.All); …Run Code Online (Sandbox Code Playgroud) 我已经开发了我的网络应用程序,并使用asp.net core 1.1将其发布到azure,它工作正常,直到我将我的Web应用程序升级到Core 2.0最终版本,现在应用程序在本地工作,但是当我将它部署到Azure它给了我这个问题 .
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
</ItemGroup>
Run Code Online (Sandbox Code Playgroud)
我只用这行代码更新.csproj文件
HTTP错误502.5 - 进程失败
这个问题的常见原因:
应用程序进程无法启动应用程序进程已启动但已停止应用程序进程已启动但无法侦听已配置的端口
故障排除步骤
检查系统事件日志中是否有错误消息启用日志记录应用程序进程'stdout消息将调试器附加到应用程序进程并检查
我试图获得价值,但它无法正常工作.下面是我的网址,我想1从网址获取数字
constructor(private router: Router,
private userService: UserService) {
this.router
.routerState
.queryParams
.subscribe(params => {
this.id = params['id'];
});
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Rotativa在asp.net核心中创建pdf,但它给我一个错误.我想创建html并将其转换为pdf,然后存储在服务器目录中
[HttpPost]
public IActionResult Index(Invoice invoice)
{
var webRoot = _env.WebRootPath;
var pdf = new ViewAsPdf("Index")
{
FileName = "Test.pdf",
PageSize = Rotativa.AspNetCore.Options.Size.A4,
PageOrientation = Rotativa.AspNetCore.Options.Orientation.Portrait,
PageHeight = 20,
};
var byteArray = pdf.BuildFile(ControllerContext).Result;
//var fileStream = new MemoryStream(Path.Combine(webRoot, pdf.FileName), FileMode.Create, FileAccess.Write);
var memoryStream = new MemoryStream(byteArray, 0, byteArray.Length);
}
Run Code Online (Sandbox Code Playgroud) 我试图制作一个错误页面,当错误的路由检测或未经授权的访问或其他类型的异常发生我想重定向到页面,并希望在我的角度应用程序在此页面上显示受尊重的错误.现在我只是通过在查询字符串中传递错误消息来做到这一点.但是我希望在没有查询字符串的情况下传递不同的异常消息我怎么能实现它.并提出建议,最好的方法是什么.
import { Inject } from '@angular/core';
import { Component } from '@angular/core';
import { OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Router } from '@angular/router';
import 'rxjs/add/operator/map';
@Component({
selector: 'error',
template: `
<h2>Error</h2>
<h4> {{ errMessage | async }} </h4>
`
})
export class ErrorComponent implements OnInit {
errMessage: Observable<string>;
constructor(@Inject(Router) private router: Router) { }
ngOnInit() {
this.errMessage = this.router.routerState.queryParams
.map(params => params['errMsg'] || '');
}
}
Run Code Online (Sandbox Code Playgroud)
import { provideRouter, …Run Code Online (Sandbox Code Playgroud) 我是天蓝色函数的新手。我正在尝试创建azure函数来发送(电子邮件,短信和通知)。首先,我为此创建了3个不同的Http触发函数。我的问题是有一种为上述所有功能创建一个通用功能的好方法,并将其作为一个功能,这是否是一种好方法。
我想在一个有两个参数的动作上发布数据,我可以实现.我在asp.net mvc 5应用程序中使用angular 2.
public ActionResult Login(string returnUrl, UserLogin _user)
{
return RedirectToAction("ExternalSignIn", new { returnUrl = returnUrl, userEmail = _user.Email });
}
Run Code Online (Sandbox Code Playgroud) 我在表单中使用ng2-select.我从api检索数据并设置到数组但它无法正常工作.吼叫是我的代码.当我硬编码它工作正常.我不知道为什么这样做,可能是因为它在响应获取数据但没有将其设置为数组之后用空数据初始化数组.
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import {Observable} from 'rxjs/Observable';
import { AuthService } from '../../services/auth/auth.service';
import {SELECT_DIRECTIVES} from 'ng2-select';
@Component({
selector: 'users-edit',
templateUrl: '../../app/components/user/user-edit.html',
directives: [SELECT_DIRECTIVES]
})
export class UserEditComponent implements OnInit{
private isAdmin: Boolean = false;
private _data: Observable;
private fname: string;
private id: number;
private lname: string;
private email: string;
private _roles: Observable;
public roles: any = [];
public groups: any = ['Group 1', 'Group 2', 'Group …Run Code Online (Sandbox Code Playgroud) 我正在尝试为此响应创建一个模型,以将数据存储到模型中并根据需要使用它
[
{
"Id": 0,
"ApimId": "5746ebcfcd7c3209247edc40",
"Name": "Atea Service Desk",
"Description": "Service Desk and Operations",
"SubscriptionRequired": false,
"ApprovalRequired": false,
"State": "published",
"Apis": [
{
"Id": 0,
"ApimId": "5746ba28804136004d040001",
"Name": "Echo API",
"Description": null,
"ServiceUrl": "http://echoapi.cloudapp.net/api",
"ScopeId": 0,
"WorkflowId": 0,
"Workflow": null,
"Scope": null,
"CreatedDate": "2016-10-04T18:49:32.2553822+05:00",
"CreatedBy": "LHR\\ahja",
"UpdatedDate": "2016-10-04T18:49:32.2553822+05:00",
"UpdatedBy": "LHR\\ahja"
},
{
"Id": 0,
"ApimId": "574c167dcd7c3216c8c633b3",
"Name": "Servicedesk and Operations",
"Description": "Atea Servicedesk and Operations Internal API",
"ServiceUrl": "http://dev-endpoint.atea.com/RFC",
"ScopeId": 0,
"WorkflowId": 0,
"Workflow": null,
"Scope": null, …Run Code Online (Sandbox Code Playgroud)