小编l--*_*'''的帖子

如何将带有特殊字符的文件名转换为有效的文件名?

我想知道是否可以在powershell中从整个目录结构中的所有文件中递归删除特殊字符?

例如,如果我有一个名为:

my presentation (fix).xlsx
Run Code Online (Sandbox Code Playgroud)

我想将其重命名为:

my presentation fix.xlsx
Run Code Online (Sandbox Code Playgroud)

谢谢你的指导。

我们需要这样做的原因是我们正在将许多文件迁移到 sharepoint 2010 并且 sharepoint 不喜欢带有特殊字符的文件!

powershell recursion sharepoint filenames file

3
推荐指数
1
解决办法
8761
查看次数

为什么Visual Studio 2015 for SQL Server项目中的单元测试显示为灰色?

我已经在我的Visual Studio 2015 c#解决方案中创建并添加了一个SQL Server项目.

我想对我的存储过程进行单元测试.右键单击其中一个过程后,它显示创建单元测试为灰色:

在此输入图像描述

我确实获得了最新的SSDT更新.

为什么创建单元测试选项显示为灰色?

以下是有关我的Visual Studio版本的信息:

  • Microsoft Visual Studio Professional 2015版本14.0.24720.00更新1 Microsoft .NET Framework版本4.6.01055
  • 已安装版本:专业版
  • Visual C#2015 Microsoft Visual C#2015
  • SQL Server数据工具14.0.50730.0 Microsoft SQL Server数据工具
  • TypeScript 1.7.6.0用于Microsoft Visual Studio的TypeScript

c# sql-server unit-testing visual-studio visual-studio-2015

3
推荐指数
1
解决办法
3214
查看次数

如何用假表示可空值?

有一个漂亮的库可以为 DTO 生成随机/伪随机值。

    var fruit = new[] { "apple", "banana", "orange", "strawberry", "kiwi" };

var orderIds = 0;
var testOrders = new Faker<Order>()
    //Ensure all properties have rules. By default, StrictMode is false
    //Set a global policy by using Faker.DefaultStrictMode
    .StrictMode(true)
    //OrderId is deterministic
    .RuleFor(o => o.OrderId, f => orderIds++)
    //Pick some fruit from a basket
    .RuleFor(o => o.Item, f => f.PickRandom(fruit))
    //A random quantity from 1 to 10
    .RuleFor(o => o.Quantity, f => f.Random.Number(1, 10));
Run Code Online (Sandbox Code Playgroud)

为 int …

.net c# bogus

3
推荐指数
2
解决办法
1708
查看次数

是否可以从.net核心查询表存储?

我正在尝试使用LINQ查询表缓存:

public static IEnumerable<DocumentMetaDataEntity> Get(string connectionString, string cacheName, DeconstructedFileName deconstructedFileName, FileMetaDataFilters filters)
{
    var acc = CloudStorageAccount.Parse(connectionString);
    var tableClient = acc.CreateCloudTableClient();
    var table = tableClient.GetTableReference(cacheName);
    var translations = from entity in table.CreateQuery<DocumentMetaDataEntity>()
                       where (entity.sourceParty == sourceParty.ToLowerTrim()
                                   && entity.destinationParty == destinationParty.ToLowerTrim())
                             || (entity.sourceParty == "YES"
                                   && entity.destinationParty == destinationParty.ToLowerTrim())
                       select entity;

    return translations.Where(x => x.expireAt > DateTime.Now)
                       .Where(x => x.effectiveAt < DateTime.Now);
}
Run Code Online (Sandbox Code Playgroud)

但是,得到此异常:

'CloudTable'不包含'CreateQuery'的定义,找不到可以接受的扩展方法'CreateQuery'接受类型为'CloudTable'的第一个参数(是否缺少using指令或程序集引用?)

我究竟做错了什么?无法从.net核心查询表缓存?

在此处输入图片说明

对于一些附加信息,以下是此类可用的创建方法:

在此处输入图片说明

这是所有依赖项:

在此处输入图片说明

我从等式中删除了LINQ,但仍然遇到以下问题:

在此处输入图片说明

完整的源代码如下:

public static IEnumerable<DocumentMetaDataEntity> Get(string connectionString, string cacheName, DeconstructedFileName deconstructedFileName, …
Run Code Online (Sandbox Code Playgroud)

.net c# azure-table-storage asp.net-core azure-functions

3
推荐指数
1
解决办法
945
查看次数

如何在角度内渲染toastr?

如何将 toastr 导入到 Angular 应用程序中?

我正在学习Angular Fundamentals课程,并尝试在我的 中简单地显示toastr.successexport class:

handleThumbnailClick(eventName){
    toastr.success(eventName)
}
Run Code Online (Sandbox Code Playgroud)

并出现以下错误:

在此输入图像描述

完整ts文件是:

import { Component, OnInit } from '@angular/core'
import { EventService } from './shared/event.service'

declare let toastr

@Component({
    selector: 'events-list',
    template: `<div>
                    <h1>upcoming angular components</h1>
                    <hr>
                    <div class="row">
                        <div class="col-md-5" *ngFor="let event of events">
                            <event-thumbnail (click)="handleThumbnailClick(event.name)" [event]="event"></event-thumbnail>
                        </div>
                </div>

</div>`})
export class EventsListComponent implements OnInit   {
    events:any[]
    constructor(private eventService: EventService) {
    }

    ngOnInit() {
        this.events = this.eventService.getEvents()
    }

    handleThumbnailClick(eventName){
        toastr.success(eventName) …
Run Code Online (Sandbox Code Playgroud)

javascript typescript toastr angular

3
推荐指数
1
解决办法
528
查看次数

使用 http 触发函数将输入绑定到表存储

是否可以(输入)绑定到 http 触发的函数中的表存储?

我正在尝试将输入绑定添加到具有以下属性的常规 http 触发函数内的表存储:

    [Table("MyTable", "MyPartition", "{httpTrigger}")] MyPoco poco
Run Code Online (Sandbox Code Playgroud)

但是,当我执行它时,它返回以下错误:

[6/5/2019 5:36:38 PM] 发生了未处理的主机错误。[6/5/2019 5:36:38 PM] Microsoft.Azure.WebJobs.Host:无法从 Azure WebJobs SDK 调用“tableStorageInputBindingHttpTriggered”。是否缺少 Azure WebJobs SDK 属性?。

此外,在启动时,我收到此异常:

[6/5/2019 6:17:17 PM] tableStorageInputBindingHttpTriggered:Microsoft.Azure.WebJobs.Host:错误索引方法“tableStorageInputBindingHttpTriggered”。Microsoft.Azure.WebJobs.Host:无法解析绑定参数“httpTrigger”。绑定表达式必须映射到触发器提供的值或触发器绑定到的值的属性,或者必须是系统绑定表达式(例如 sys.randguid、sys.utcnow 等)。

这是完整的功能:

public class MyPoco
{
    public string PartitionKey { get; set; }
    public string RowKey { get; set; }
    public string Directory { get; set; }
}

public static class tableStorageInputBindingHttpTriggered
{
    [FunctionName("tableStorageInputBindingHttpTriggered")]
    public static async Task<IActionResult> Run(
    [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, …
Run Code Online (Sandbox Code Playgroud)

.net c# azure azure-table-storage azure-functions

3
推荐指数
1
解决办法
1778
查看次数

如何将逻辑应用程序运行 ID 传递给外部服务以启用跟踪?

逻辑应用程序是否允许我们访问标识符(每次运行的 id)?

逻辑应用程序为每次运行生成一个 ID,例如:

在此输入图像描述

我们如何identifier在逻辑应用程序运行中捕获此信息,以便能够将其作为跟踪 ID 传递给下游服务?

例如,流程可能是:

  1. 运行逻辑应用程序
  2. 调用HTTP函数,传递标识符,例如08586417615830234507761283917CU08给它

我们如何获取运行中的标识符?

azure azure-logic-apps

3
推荐指数
1
解决办法
1899
查看次数

2
推荐指数
1
解决办法
1156
查看次数

除clickonce之外另一种发布方式?

vb.net有不同的方法来构建应用程序而不使用clickonce吗?

vb.net clickonce

2
推荐指数
1
解决办法
4720
查看次数

wikipedia.com上的"随机文章"功能

我想知道维基百科用什么算法和什么编程语言来随机选择要显示的文章.

我还想知道它如何运作如此之快?

random wiki

2
推荐指数
1
解决办法
1086
查看次数