小编Moh*_*yan的帖子

在SQL Server中将Identity列重置为零?

如何在SQL Server中将表的标识列重置为零?

编辑:

我们怎么能用LINQ to SQL做到这一点?

c# sql-server identity-column linq-to-sql

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

在Microsoft和Facebook oauth2,MVC C#中,ExternalLoginInfo电子邮件始终为空?

我正在使用以下代码ExternalLoginCallback
google一切正常.但是Facebook并且Microsoft loginInfo.Email始终为空.以下代码有什么问题?

    [AllowAnonymous]
public async Task<ActionResult> ExternalLoginCallback(string returnUrl)
{
    ExternalLoginInfo loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
    if (loginInfo == null)
    {
        return RedirectToAction("Login");
    }

    // loginInfo.Email is always null, so FindByEmailAsync throws an exception
    UserIdentityModel user = await UserManager.FindByEmailAsync(loginInfo.Email); 

    if (user != null)
    {
        await SignInAsync(user, false);
        return RedirectToLocal(returnUrl);
    }

    // If the user does not have an account, then prompt the user to create an account
    ViewBag.ReturnUrl = returnUrl;
    ViewBag.LoginProvider = loginInfo.Login.LoginProvider;
    return …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc oauth oauth-2.0

14
推荐指数
2
解决办法
4922
查看次数

ng-container的内部HTML,Angular 4?

我想动态地在我的html代码中放置一个HTML代码,所以我写下面的代码:

<ng-container [innerHTML]="buttonIcon"></ng-container>
Run Code Online (Sandbox Code Playgroud)

Angular说innerHTML不是有效的属性,ng-container
我不想使用如下的第三个html标签:

<div [innerHTML]="buttonIcon"></div>
Run Code Online (Sandbox Code Playgroud)

那么如何在没有任何标签内部html绑定的情况下插入html代码呢?

html angular

14
推荐指数
2
解决办法
6408
查看次数

通过HTML文件中的链接打开exe文件?

我想通过HTML文件中的链接打开exe文件.

可能吗?如果是这样,怎么样?

html

11
推荐指数
4
解决办法
7万
查看次数

在MVC3中的每个Action之前运行一个方法

如何在MVC3中运行每个Action之前运行一个方法?

我知道我们可以使用以下方法OnActionExecuting:

public class ValidateUserSessionFilterAttribute : ActionFilterAttribute
{
    public override void OnActionExecuting(ActionExecutingContext filterContext)
    {
      ...
    }
}
Run Code Online (Sandbox Code Playgroud)

但是如何在ActionExecuting之前运行一个方法呢?

c# asp.net action-filter asp.net-mvc-3

10
推荐指数
1
解决办法
7681
查看次数

更新2后Visual Studio 2013崩溃了吗?

我刚刚安装了Visual Studio 2013 Update 2(我的操作系统是Windows 8).
安装后,每当我打开Visual Studio时,我都会收到以下错误:

VS 2013错误

这可以,直到这里,但如果我打开一个项目,Visual Studio会崩溃

Visual Studio 2013在更新2后崩溃

ActivityLog.xml中的最后记录:

<entry>
    <record>964</record>
    <time>2014/05/20 19:38:45.997</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Entering function CVsPackageInfo::HrInstantiatePackage</description>
    <guid>{A6EFEF5F-BE9B-432A-ADFE-74A119AB4478}</guid>
  </entry>
  <entry>
    <record>965</record>
    <time>2014/05/20 19:38:45.997</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [JSONPackage]</description>
    <guid>{A6EFEF5F-BE9B-432A-ADFE-74A119AB4478}</guid>
  </entry>
  <entry>
    <record>966</record>
    <time>2014/05/20 19:38:45.998</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>CreateInstance failed for package [JSONPackage]</description>
    <guid>{A6EFEF5F-BE9B-432A-ADFE-74A119AB4478}</guid>
    <hr>80070002</hr>
    <errorinfo>Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web Tools\Languages\Microsoft.VisualStudio.JSON.Package.dll' or one of its dependencies. The system cannot find the file specified.</errorinfo>
  </entry>
  <entry>
    <record>967</record>
    <time>2014/05/20 19:38:46.013</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>End …
Run Code Online (Sandbox Code Playgroud)

crash updates visual-studio-2013

10
推荐指数
1
解决办法
4887
查看次数

通过WPF中的XAML代码加载外部图像?

lock.pngimages文件夹中的WPF exe文件旁边有一个图像.现在,我将把它作为图像加载到WPF项目中,我使用了以下XAML代码:

<Image Stretch="Fill" Source="pack://siteoforigin:,,,/images/lock.png" />
Run Code Online (Sandbox Code Playgroud)

它的工作原理,但Expression Blend还是Visual Studio没有表现出来,当我工作的项目.
在这些情况下我们如何显示外部图像?

c# wpf xaml image expression-blend

9
推荐指数
2
解决办法
2万
查看次数

在我的C#Win应用程序中打开Windows计算器?

我知道我可以使用以下代码打开Windows Calculator:

System.Diagnostics.Process.Start("calc");
Run Code Online (Sandbox Code Playgroud)

但是我想在我的C#Win应用程序中打开它,即:我不想在独立窗口中打开它,我想在我的窗口中打开它.
我该怎么做 ?

.net c# system.diagnostics calculator windows-7

9
推荐指数
3
解决办法
3万
查看次数

从wsdl文件更新asp.net WebService引用?

在asp.net中是否可以从本地驱动器上的wsdl文件更新或创建Web服务引用?如果是这样,你能描述一下吗?

asp.net wsdl web-services

9
推荐指数
1
解决办法
1万
查看次数

SwaggerUI 不显示枚举摘要描述,C# .net 核心?

我使用https://docs.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-2.1&tabs=visual-studio#xml-comments来显示我的课程摘要说明在 SwaggerUI 中,可以但不显示enum摘要描述!
我的startup.cs

services.AddSwaggerGen(c =>
{   
    c.SwaggerDoc("v1", new Info
    {
        Version = "v1",
        Title = "My App-Service",
        Description = "My Description",
    });
    c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"));  
    c.DescribeAllEnumsAsStrings();
});
Run Code Online (Sandbox Code Playgroud)

我的enum

public enum GenderEnum
{
    /// <summary>
    /// Man Description
    /// </summary>
    Man = 1,

    /// <summary>
    /// Woman Description
    /// </summary>
    Woman = 2
}
Run Code Online (Sandbox Code Playgroud)

它显示如下内容:
Swagger UI 枚举

我想像 这样在 SwaggerUI 中显示Man Description和显示:Woman Description

Man = 1, Man Description
Woman = 2,  Woman Description …
Run Code Online (Sandbox Code Playgroud)

c# enums swagger-ui .net-core asp.net-core-webapi

9
推荐指数
3
解决办法
9093
查看次数