C# 用于选择文件夹及其子文件夹的正则表达式
几天来,我一直在尝试使用正确的正则表达式来选择文件夹及其子文件夹 这是为了避免在站点地图中生成标识文件夹。 该项目位于.NETCore2.2Razor页面中 根据在线测试人员的说法,我的正则表达式很好,但在实践中不起作用 Startup.csC# 用于选择文件夹及其子文件夹的正则表达式,c#,asp.net-core,razor-pages,C#,Asp.net Core,Razor Pages,几天来,我一直在尝试使用正确的正则表达式来选择文件夹及其子文件夹 这是为了避免在站点地图中生成标识文件夹。 该项目位于.NETCore2.2Razor页面中 根据在线测试人员的说法,我的正则表达式很好,但在实践中不起作用 Startup.cs public void ConfigureServices(IServiceCollection services) { services.Configure<CookiePolicyOptions>(options =
public void ConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(
Configuration.GetConnectionString("DefaultConnection")));
services.AddIdentity<ApplicationUser, ApplicationRole>(options => options.Stores.MaxLengthForKeys = 128).AddEntityFrameworkStores<ApplicationDbContext>().AddDefaultUI().AddDefaultTokenProviders();
services.Configure<IdentityOptions>(options =>
{
// Password settings
options.Password.RequireDigit = true;
options.Password.RequiredLength = 8;
options.Password.RequireNonAlphanumeric = false;
options.Password.RequireUppercase = true;
options.Password.RequireLowercase = false;
options.Password.RequiredUniqueChars = 6;
// Lockout settings
options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(30);
options.Lockout.MaxFailedAccessAttempts = 10;
options.Lockout.AllowedForNewUsers = true;
// User settings
options.User.RequireUniqueEmail = true;
});
services.ConfigureApplicationCookie(options =>
{
// Cookie settings
options.Cookie.HttpOnly = true;
options.Cookie.Expiration = TimeSpan.FromDays(150);
// If the LoginPath isn't set, ASP.NET Core defaults
// the path to /Account/Login.
options.LoginPath = "/Account/Login";
// If the AccessDeniedPath isn't set, ASP.NET Core defaults
// the path to /Account/AccessDenied.
options.AccessDeniedPath = "/Account/AccessDenied";
options.SlidingExpiration = true;
});
services.AddDbContext<VolkaDbContext>();
services.AddTransient<IBlogRepository, BlogRepository>();
services.AddTransient<IPortfolioRepository, PortfolioRepository>();
services.AddRouting(options =>
{
options.LowercaseUrls = true;
});
services.AddRazorPagesSitemap(options=> {
options.IgnoreExpression = @".*\/Identity\/(?!example).*";
});
services.AddDirectoryBrowser();
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
}
public void配置服务(IServiceCollection服务)
{
配置(选项=>
{
//此lambda确定给定请求是否需要非必要cookie的用户同意。
options.checkApprovered=context=>true;
options.MinimumSameSitePolicy=SameSiteMode.None;
});
services.AddDbContext
会有人给我建议吗
好的,谢谢你请学习堆栈溢出是如何工作的,并阅读如何提高问题的质量。请将你的问题包括在问题本身中的正则表达式,而不是在外部网站上。还包括你对正则表达式的输入以及你想要匹配/检查的内容。同时显示实际的源代码c你有一个ode,并解释此代码的问题是什么。你谈论文件夹和子文件夹,但粘贴了一些完全不相关的代码,没有正则表达式,也没有输入数据。如何,粘贴一个测试数据列表,以及你预期的结果,以及你使用的正则表达式?