小编Zoi*_*nky的帖子

Google商家信息搜索 - 下一页令牌会返回相同的结果

我打电话的时候

https://maps.googleapis.com/maps/api/place/nearbysearch/xml?location=42.9825,-81.254&radius=50000&name=Medical%22Clinic&sensor=false&key=[KEY GOES HERE]
Run Code Online (Sandbox Code Playgroud)

我得到一组结果,其中next_page_token可用

现在,如果我这样做

https://maps.googleapis.com/maps/api/place/nearbysearch/xml?location=42.9825,-81.254&radius=50000&name=Medical%22Clinic&sensor=false&key=[KEY GOES HERE]&next_page_token=[NEXT PAGE TOKEN GOES HERE]
Run Code Online (Sandbox Code Playgroud)

我得到的结果与第一个查询相同,而不是下一组结果

google-places-api

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

Scaffold-DbContext - CultureNotFoundException:全球化不变模式仅支持不变区域性。par'name' en-us 无效

Scaffold-DbContext "connection string" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Entities 
Run Code Online (Sandbox Code Playgroud)

我正在运行上面的命令,但出现以下错误,并尝试使用 .NET 7 和 8 预览版。

我什至添加<InvariantGlobalization>true</InvariantGlobalization>到项目中,但没有做任何事情。

<PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)

System.Globalization.CultureNotFoundException:全球化不变模式仅支持不变区域性。有关详细信息,请参阅 https://aka.ms/GlobalizationInvariantMode 。(参数“name”)en-us 是无效的区域性标识符。在System.Globalization.CultureInfo.GetCultureInfo(字符串名称)在Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource 1 retry, SqlConnectionOverrides overrides) at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides) at Microsoft.Data.SqlClient.SqlConnection.Open() at Microsoft.EntityFrameworkCore.SqlServer.Scaffolding.Internal.SqlServerDatabaseModelFactory.Create(DbConnection connection, DatabaseModelFactoryOptions options) at Microsoft.EntityFrameworkCore.SqlServer.Scaffolding.Internal.SqlServerDatabaseModelFactory.Create(String connectionString, DatabaseModelFactoryOptions options) at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineerScaffolder.ScaffoldModel(String connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions) at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContext(String provider, String connectionString, String outputDir, String outputContextDir, String dbContextClassName, IEnumerable1架构,IEnumerable 1 tables, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean …

c# entity-framework-core

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

验证 .NET Core 3.0 中的字符串是否为有效的 json(可能的最快方式)

我知道我可以使用外部库(newtonsoft)和 try/catch 来检查字符串是否是有效的 json 结构。我不想反序列化为一个对象(因为 json 可以是一个或多个属性),重点是确保其有效的 json。

我更喜欢使用 System.Text.Json 但不确定什么是最好的,TryParseValue、JsonDocument 等

json .net-core

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

Google Place Autocomplete未显示在Bootstrap模式中

FIX UPDATE:似乎我正在初始化盒子的方式导致问题在这里解决了什么

 <script>
    $(function () {
        var input = document.getElementById("keyword");
        var autocomplete = new google.maps.places.Autocomplete(input);

        $('#my-modal').modal('show');

    });

</script>
<style>
    .pac-container {
        z-index: 10000 !important;
    }
</style>
Run Code Online (Sandbox Code Playgroud)

更新:我已经更新了代码非常简单,这个http://jsfiddle.net/g8vxmLn9/1/ 工作的原因是因为它使用较旧的bootstrap和jquery所以我假设因为我使用较新我遇到了问题.

我只想在bootstrap(3.3)模型中显示一个自动完成框,并在键入时显示结果.

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Test</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-2.2.2.min.js" integrity="sha256-36cp2Co+/62rEAAYHLmRCPIych47CvdM+uTBJwSzWjI=" crossorigin="anonymous"></script>
<script src="https://maps.googleapis.com/maps/api/js?libraries=places">   </script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
</head>
<body>
<div>
    <div id="my-modal" class="modal" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <input name="keyword" id="keyword" type="text" />
            </div>

        </div>
    </div>
</div>
<script>
    $(function () {
        $("#my-modal").modal({ …
Run Code Online (Sandbox Code Playgroud)

google-maps-api-2 bootstrap-modal

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

关闭 EFCore 中的全局过滤器警告

我对我的一个实体有一个过滤器

 entity.HasQueryFilter(x => !x.IsDeleted);
Run Code Online (Sandbox Code Playgroud)

我不断在日志中收到以下警告,我想将其关闭

实体“Event”已定义全局查询过滤器,并且是与实体“EventCategory”的关系所需的结束。当所需实体被过滤掉时,这可能会导致意外结果。将导航配置为可选,或者为导航中的两个实体定义匹配的查询过滤器。有关详细信息,请参阅https://go.microsoft.com/fwlink/?linkid=2131316 。

entity-framework entity-framework-core

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

jquery插入div中的最后一个元素

我正在使用ajax返回一些数据,我想将它作为第二个孩子插入div.问题是我如何在div中的最后一个元素之前插入一些html到div

 $.ajax({
        url: '@Url.Action("...", "..")',
        traditional: true,
        data: { coordinates: coordinates, selectedTypeIDs: selectedTypeIDs, pageNumber: pageNumber },
        type: 'POST',
        success: function (data) {


            $('#listings').insertBefore(".last-child", data);
            hideProgress();
        },
        error: function (xhr, textStatus, errorThrown) {
            showErrorMessage("Something whacky happened", errorThrown);

        }
Run Code Online (Sandbox Code Playgroud)

这是我的,div并在其中一个评论,显示我想把它放在哪里

<div id="listings">
    <!--bunch of divs-->
    <div>something</div>
    <!--INSERT DATA HERE-->
    <div class="black_box2" id="showMoreBar"></div>
</div>
Run Code Online (Sandbox Code Playgroud)

我可以使用类名black_box2或更好,我分配给最后一个的id div,或者更快的方式

jquery

8
推荐指数
1
解决办法
8769
查看次数

Kendo ui - 在子添加/编辑时获取父网格项(网格层次结构)

我有一个包含3个项目的父网格,每个项目都有一个子网格作为细节的一部分.当调用CHILD上的编辑事件时,我想获取父(masterrow)的数据,下面的代码总是得到mastergrid中的第一项,而不是单击的项的实际父项,例如,如果我编辑/添加网格中的一个项目用于主网格中的第二个项目,它仍然获取主网格数据的第一项.

 var parentData = $("#gridRoomTypes").data("kendoGrid").dataItem(e.container.closest("tr"));
Run Code Online (Sandbox Code Playgroud)

编辑有:

 e.sender (child grid), e.container, e.model "gridRoomTypes" is my master grid
Run Code Online (Sandbox Code Playgroud)

javascript jquery datagrid kendo-ui kendo-grid

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

从 ASP.NET Core 应用程序启动外部进程 (.exe)

我有以下内容

[HttpPost]
public IActionResult LaunchExternalProcess()
{
    Process.Start("C:\\Windows\\System32\\calc.exe");
    return Ok();

}
Run Code Online (Sandbox Code Playgroud)

这在我的本地计算机上运行得很好,但是当部署到 IIS 10(Windows 2016)上时,我没有收到任何错误,但它不会在服务器上启动计算。

我只想通过页面上的按钮调用外部 .exe。

这是我正在使用的 javascript,它也适用于我的本地,但在服务器上没有错误,并且显示成功消息

$.ajax({
    url: "/Admin/LaunchExternalProcess",
    type: "POST",
    cache: false,

    success: function () {

        console.log("success");
    }
});
Run Code Online (Sandbox Code Playgroud)

iis asp.net-core-mvc kestrel-http-server asp.net-core asp.net-core-2.0

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

Serilog无法从asp.net Core 2.2 API中的配置工作

public class Program
{
    public static void Main(string[] args)
    {
        CreateWebHostBuilder(args).Build().Run();
    }

    public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
           .UseSerilog((ctx, config) => { config.ReadFrom.Configuration(ctx.Configuration); })
           .UseStartup<Startup>();
}


public class Startup
{
    public IContainer Container { get; private set; }
    public Startup(IConfiguration configuration)
    {
        Log.Warning("test");
        Configuration = configuration;
    }

}
Run Code Online (Sandbox Code Playgroud)

appsettings.json

{
    "Serilog": {
    "MinimumLevel": {
      "Default": "Information",
      "Override": {
        "Default": "Information",
        "Microsoft": "Information",
        "System": "Information"
      }
    },
    "WriteTo": [

      {
        "Name": "RollingFile",
        "Args": {
          "pathFormat": "C:\\test.txt",
          "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.ffff}|{TenantName}|{RequestId}|{SourceContext}|{Level:u3}|{Message:lj}{NewLine}{Exception}",
          "restrictedToMinimumLevel": …
Run Code Online (Sandbox Code Playgroud)

c# serilog asp.net-core

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

阻止bingbot抓取我的网站

我想完全阻止bing爬行我的网站(它以惊人的速度攻击我的网站(每月500GB的数据).

我有很多子域名添加到bing网站管理员工具,所以我不能去设置每个人的抓取速度.我尝试使用robots.txt阻止它,但它在这里不起作用的是我的robots.txt

# robots.txt 
User-agent: *
Disallow:
Disallow: *.axd
Disallow: /cgi-bin/
Disallow: /member
Disallow: bingbot
User-agent: ia_archiver
Disallow: /
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc .htaccess robots.txt bots bing

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