小编mor*_*rck的帖子

MVC4与TinyMCE捆绑在一起

我在使用MVC4 Bundling和TinyMCE时遇到了问题.我收到此错误:

    GET http://localhost:54717/Admin/EditText//langs/da.js 404 (Not Found) Site:1
    GET http://localhost:54717/Admin/EditText//plugins/lists/editor_plugin.js 404 (Not Found) Site:1
    GET http://localhost:54717/Admin/EditText//plugins/autolink/editor_plugin.js 404 (Not Found) Site:1
    GET http://localhost:54717/Admin/EditText//themes/advanced/editor_template.js 404 (Not Found) Site:1
    GET http://localhost:54717/Admin/EditText//plugins/spellchecker/editor_plugin.js 404 (Not Found) Site:1
    GET http://localhost:54717/Admin/EditText//plugins/pagebreak/editor_plugin.js 404 (Not Found) Site:1
    GET http://localhost:54717/Admin/EditText//plugins/style/editor_plugin.js 404 (Not Found) Site:1
    GET http://localhost:54717/Admin/EditText//plugins/table/editor_plugin.js 404 (Not Found) Site:1
    GET http://localhost:54717/Admin/EditText//plugins/layer/editor_plugin.js 404 (Not Found) Site:1
    GET http://localhost:54717/Admin/EditText//plugins/save/editor_plugin.js 404 (Not Found)
Failed to load: http://localhost:54717/Admin/EditText//langs/da.js 
Run Code Online (Sandbox Code Playgroud)

代码看起来像这样(在BundleConfig.cs中)

bundles.Add(
      new ScriptBundle("~/Scripts/Site").Include(
        "~/Scripts/jquery-1.9.1.js",
        "~/Scripts/tinymce/tiny_mce.js",
         "~/Scripts/jquery-ui-1.10.1.js",
        "~/Scripts/jquery.ui.slider.js",
        "~/Scripts/oline.Base.js",
        "~/Scripts/Validate/Language/jquery.validationEngine-da.js",
        "~/Scripts/Validate/jquery.validationEngine.js",
        "~/Scripts/jquery.ui.effect-blind.js",
        "~/Scripts/jquery.placeholder.min.js"));

      BundleTable.EnableOptimizations = …
Run Code Online (Sandbox Code Playgroud)

bundle tinymce asp.net-mvc-4

27
推荐指数
3
解决办法
7043
查看次数

智能卡读卡器,无法读取一些卡

我有一个使用智能卡读卡器的应用程序允许用户访问系统的各个部分.在一个地方我没有问题.但是另一种具有不同类型的卡制造商的问题存在很多问题.它不断获得零回报.然后查看事件日志,我看到了这个: 在此输入图像描述 这是代码:

 card.Connect(reader, SHARE.Shared, PROTOCOL.T0orT1);

 var apduGetID = new APDUCommand(0xFF, 0xCA, 0, 0, null, 4);
 var apduRespGetID = card.Transmit(apduGetID);
long cardId = BitConverter.ToUInt32(apduRespGetID.Data.Reverse().ToArray(), 0);
Run Code Online (Sandbox Code Playgroud)

第二个问题是,然后尝试调试代码,它工作完美,只有删除断点,我可以看到问题,但不是在哪里.有人可以帮帮我吗?

PS我找到了这个帖子,但它不起作用:https://superuser.com/questions/715688/smart-card-errors

更新:这是Transmit类

 public override APDUResponse Transmit(APDUCommand ApduCmd)
        {
            var RecvLength = (uint)(ApduCmd.Le + APDUResponse.SW_LENGTH);
            byte[] ApduBuffer;
            var ApduResponse = new byte[ApduCmd.Le + APDUResponse.SW_LENGTH];
            var ioRequest = new SCard_IO_Request
            {
                m_dwProtocol = m_nProtocol,
                m_cbPciLength = 8
            };

            // Build the command APDU
            if (ApduCmd.Data == null)
            {
                ApduBuffer = new byte[APDUCommand.APDU_MIN_LENGTH + ((ApduCmd.Le …
Run Code Online (Sandbox Code Playgroud)

c# smartcard

19
推荐指数
1
解决办法
1611
查看次数

未为项目TFS2012设置OutputPath属性

我在我们的Team Foundation服务器中有一个构建,它提供了这个交战:

C:\ Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(610):未为项目"Plugin.DeploymentTool.csproj"设置OutputPath属性.请检查以确保您为此项目指定了Configuration和Platform的有效组合.Configuration ='Release'Blatter ='x86'.您可能会看到此消息,因为您正在尝试构建没有解决方案文件的项目,并且已指定了此项目不存在的非默认配置或平台.

我找不到任何解决方案或为什么我得到这个错误.但后来我看了生成的zip文件,Binary文件夹是空的.我试图使用x86,x64和Any CPU,如果有任何差异,那就没有了.

如果我查看项目文件,它看起来没问题.

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
Run Code Online (Sandbox Code Playgroud)

tfs tfsbuild tfs2012

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

Leaflet.Draw矩形的坐标

是否有可能在mouseClick上获取矩形的坐标,所以我有矩形的所有角?

javascript leaflet leaflet.draw

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

使用SQLCMD进行动态调用的更智能方式

我有这个MSSQL SQLCMD代码,它可以登录数据库,在这只需要一个SELECT语句:

   :CONNECT czasql-001
   SELECT * FROM [Lps_Hepper_Cz].[config].[LpsPlant]
  GO

    :CONNECT LS_Hepper_DK

    SELECT * FROM [LPS_Hepper_NY].[config].[LpsPlant]

    :CONNECT LS_Hepper_DK
    SELECT * FROM [LPS_Hepper_DK].[config].[LpsPlant]

    :CONNECT LS_Hepper_DK
    SELECT * FROM [LPS_Hepper_SUPPLIER].[config].[LpsPlant]
    GO

           :CONNECT LS_Hepper_372
    SELECT * FROM [LPS_Hepper_MO].[config].[LpsPlant]
    GO

           :CONNECT LS_Hepper_678
    SELECT * FROM [LPS_Hepper_678].[config].[LpsPlant]
    GO
Run Code Online (Sandbox Code Playgroud)

此解决方案可以正常工作,但要求我多次复制粘贴副本以更改数据库名称.但是有人可以通过使用循环来帮助我改进这一点.我试过使用临时表.像这样:

 declare @tbl table (ServerName nvarchar(50), DbName nvarchar(50), IsDone bit default(0))
 insert into @tbl (ServerName,DbName) VALUES ('CZASQL-001', '[Lps_Hepper_CZ]')
 insert into @tbl (ServerName,DbName) VALUES ('LS_Hepper_DK',  '[Lps_Hepper_DK]')
 insert into @tbl (ServerName,DbName) VALUES ('LS_Hepper_DK',  '[Lps_Hepper_NY]')
 insert into @tbl (ServerName,DbName) VALUES ('LS_Hepper_DK', …
Run Code Online (Sandbox Code Playgroud)

sql sql-server sqlcmd

11
推荐指数
1
解决办法
790
查看次数

MVC4捆绑版本控件

我在我的网站上使用Asp.Net MVC4捆绑.但是有没有办法进行任何版本控制,那么我发布一个新版本我可以更改版本号并强制在客户端浏览器中刷新?

bundle asp.net-mvc-4

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

如何正确使用RedirectToAction

我在mvc中使用RedirectToAction方法时遇到问题.我的地图路线看起来像这样.

             routes.MapRoute(
         "Project",  // Route name
         "{Controller}/{Action}/{projectId}/{machineName}/{companyId}",
          new { controller = "Project", action = "Directives", projectId = 0, machineName = "", companyId = 0 }  // Parameter defaults);
Run Code Online (Sandbox Code Playgroud)

返回看起来像这样:

 return RedirectToAction("Directives", "Project", new { projectId = projectId, machineName = project.MachineName, CompanyId = user.Company_Id });
Run Code Online (Sandbox Code Playgroud)

它工作正常,但我使用RedirectToAction它仍然看起来像这样

http://localhost:1843/Project/Directives?projectId=48&machineName=Netduino&companyId=27
Run Code Online (Sandbox Code Playgroud)

控制器:

        [HttpPost]
    [ValidateInput(false)]
    public ActionResult Create(Project project, string text)
    {
        ViewBag.MachineType = new List<string>(new string[] { "Machine Type A", "Machine Type B", "Machine Type C", "Machine Type D", "Machine Type E" });

        if (ModelState.IsValid) …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc-3

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

在MVC4中捕获404错误

我有一个问题,因为HTTP错误404.0 - 未找到.我打开了

<customErrors mode="On" defaultRedirect="~/Error/General">
      <error statusCode="404" redirect="~/Error/HttpError404" />
      <error statusCode="500" redirect="~/Error/HttpError500" />
    </customErrors>
Run Code Online (Sandbox Code Playgroud)

在Web.Config中.但问题仍然存在.我也试过这个解决方案(但它永远不会到达方法):

protected void Application_Error()
    {
      var exception = Server.GetLastError();
      var httpException = exception as HttpException;
      Response.Clear();
      Server.ClearError();
      var routeData = new RouteData();
      routeData.Values["controller"] = "Errors";
      routeData.Values["action"] = "General";
      routeData.Values["exception"] = exception;
      Response.StatusCode = 500;
      if (httpException != null)
      {
        Response.StatusCode = httpException.GetHttpCode();
        switch (Response.StatusCode)
        {
          case 403:
            routeData.Values["action"] = "HttpError404";
            break;
          case 404:
            routeData.Values["action"] = "HttpError404";
            break;
        }
      }

      IController errorsController = new ErrorController();
      var …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc-4 iis-8

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

Leafletjs上的设置投影

我使用Leafletjs作为家庭项目(现在看起来很好看.但我找不到必须设置投影,我已经找到了OpenLayers,它看起来像这样:

// Openlayers settings 
    //var defaultMaxExtent = new OpenLayers.Bounds(427304, 6032920, 927142, 6485144); 
    var defaultMaxExtent = new OpenLayers.Bounds(427304, 6032920, 927142, 6485144);

    var defaultProjection = "EPSG:25832";
    var defaultUnits = "Meters";
    var defaultResolutions = new Array(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024);
    var defaultExtent = new OpenLayers.Bounds(215446, 2103547, 706886, 6203897); //this extent is used when the page is loaded.
    //var defaultExtent = new OpenLayers.Bounds(705446, 6203547, 706886, 6203897); //this extent is used when the page is loaded.
    map = …
Run Code Online (Sandbox Code Playgroud)

map-projections leaflet

6
推荐指数
1
解决办法
9025
查看次数

从ASP.Net MVC连接到MySQL数据库

即时退出ASP.Net MVC World新手.但我找不到任何例子,如何从ASP.Net MVC网站连接到MySQL数据库服务器.谁能帮忙?

mysql asp.net-mvc

5
推荐指数
1
解决办法
9670
查看次数