阿里云 C# .NET 实人人脸认证

官方网站上能找到的文档都是乱七八糟的,百度搜索也搜索不出什么,最后找到了OpenAPI页面,对着示例编写最后是成功了。有关阿里云的接口都在这里面找就是了,不要再翻帮助文档了。如下是实人认证的连接。各个语言版本都有,挺不错。

地址:https://next.api.aliyun.com/api/Cloudauth/2019-03-07/InitFaceVerify?tab=DEMO&lang=CSHARP

下面总结C#写法:

1、nuget中搜索“AlibabaCloud.SDK.Cloudauth20190307”并安装

2、参考官方OpenAPI对如下代码进行修改。认证时调用下面的InitFaceVerify方法即可。

/// <summary>
/// 接口
/// </summary>
/// <returns></returns>
public JsonResult InitFaceVerify()
{
var renyuanObj = Session[“userid”];

//检查是否已通过验证
var isvalidObj = new JinXin().GetRenyuanByActualid(renyuanObj.身份证号);
if (isvalidObj.认证字符 + “” != “”)
{
return Json(“{\”Message\”: \”已完成认证,请勿重复提交。\”,\”Code\”: \”100\”}”);
}

AlibabaCloud.SDK.Cloudauth20190307.Client client = CreateClient(accessKeyId, accessKeySecret);
AlibabaCloud.SDK.Cloudauth20190307.Models.InitFaceVerifyRequest initFaceVerifyRequest = new AlibabaCloud.SDK.Cloudauth20190307.Models.InitFaceVerifyRequest
{
SceneId = 1000000000,
OuterOrderNo = “1b255e9d2ed14e40b60601b9ad0012f4”,
ProductCode = “ID_PRO”,
CertType = “IDENTITY_CARD”,
CertName = renyuanObj.姓名,
CertNo = renyuanObj.身份证号,
ReturnUrl = Request.Url.ToString().Substring(0, Request.Url.ToString().ToLower().IndexOf(“/jinxin”)) + “/Jinxin/AuthPersonPass”,
MetaInfo = Request.Form[“MetaInfo”] + “”
};
var objResponse = client.InitFaceVerify(initFaceVerifyRequest);
if (objResponse.Body.Code == “200”)
{
Session[“FaceVerify_CertifyId”] = objResponse.Body.ResultObject.CertifyId;
}
return Json(objResponse.Body.ToJsonString());
}

/**
* 使用AK&SK初始化账号Client
* @param accessKeyId
* @param accessKeySecret
* @return Client
* @throws Exception
*/
public AlibabaCloud.SDK.Cloudauth20190307.Client CreateClient(string accessKeyId, string accessKeySecret)
{
AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config();
// 您的AccessKey ID
config.AccessKeyId = accessKeyId;
// 您的AccessKey Secret
config.AccessKeySecret = accessKeySecret;
// 访问的域名
config.Endpoint = “cloudauth.aliyuncs.com”;
return new AlibabaCloud.SDK.Cloudauth20190307.Client(config);
}

 

 

3、人脸完成后,在最后页面调用如下查询结果的代码

   AlibabaCloud.SDK.Cloudauth20190307.Client client = CreateClient(accessKeyId, accessKeySecret);
            AlibabaCloud.SDK.Cloudauth20190307.Models.DescribeFaceVerifyRequest describeFaceVerifyRequest = new AlibabaCloud.SDK.Cloudauth20190307.Models.DescribeFaceVerifyRequest
            {
                SceneId = 1000000000,
                CertifyId = Request.QueryString["vid"] + ""
            };
            var objResponse = client.DescribeFaceVerify(describeFaceVerifyRequest);
            if (objResponse.Body.ResultObject.Passed == "T")   //T为通过
            {
                JObject jobj = JObject.Parse(objResponse.Body.ResultObject.MaterialInfo);
                ViewBag.VerifyInfo = jobj.SelectToken("facialPictureFront")["pictureUrl"];
            }

 

js 冻结表格行列

原文:https://blog.csdn.net/wdd304159787/article/details/84922234

   function freezeTable(table, freezeRowNum, freezeColumnNum, width, height) {
        width = document.body.clientWidth - document.body.clientWidth * 0.05;
        height= 400;

        if (typeof (freezeRowNum) == 'string')
            freezeRowNum = parseInt(freezeRowNum)

        if (typeof (freezeColumnNum) == 'string')
            freezeColumnNum = parseInt(freezeColumnNum)

        var tableId;
        if (typeof (table) == 'string') {
            tableId = table;
            table = $('#' + tableId);
        } else
            tableId = table.attr('id');

        var divTableLayout = $("#" + tableId + "_tableLayout");

        if (divTableLayout.length != 0) {
            divTableLayout.before(table);
            divTableLayout.empty();
        } else {
            table.after("<div id='" + tableId + "_tableLayout' style='overflow:hidden;height:" + height + "px; width:" + width + "px;'></div>");

            divTableLayout = $("#" + tableId + "_tableLayout");
        }

        var html = '';
        if (freezeRowNum > 0 && freezeColumnNum > 0)
            html += '<div id="' + tableId + '_tableFix" style="padding: 0px;"></div>';

        if (freezeRowNum > 0)
            html += '<div id="' + tableId + '_tableHead" style="padding: 0px;"></div>';

        if (freezeColumnNum > 0)
            html += '<div id="' + tableId + '_tableColumn" style="padding: 0px;"></div>';

        html += '<div id="' + tableId + '_tableData" style="padding: 0px;"></div>';


        $(html).appendTo("#" + tableId + "_tableLayout");

        var divTableFix = freezeRowNum > 0 && freezeColumnNum > 0 ? $("#" + tableId + "_tableFix") : null;
        var divTableHead = freezeRowNum > 0 ? $("#" + tableId + "_tableHead") : null;
        var divTableColumn = freezeColumnNum > 0 ? $("#" + tableId + "_tableColumn") : null;
        var divTableData = $("#" + tableId + "_tableData");

        divTableData.append(table);

        if (divTableFix != null) {
            var tableFixClone = table.clone(true);
            tableFixClone.attr("id", tableId + "_tableFixClone");
            divTableFix.append(tableFixClone);
        }

        if (divTableHead != null) {
            var tableHeadClone = table.clone(true);
            tableHeadClone.attr("id", tableId + "_tableHeadClone");
            divTableHead.append(tableHeadClone);
        }

        if (divTableColumn != null) {
            var tableColumnClone = table.clone(true);
            tableColumnClone.attr("id", tableId + "_tableColumnClone");
            divTableColumn.append(tableColumnClone);
        }

        $("#" + tableId + "_tableLayout table").css("margin", "0");

        if (freezeRowNum > 0) {
            var HeadHeight = 0;
            var ignoreRowNum = 0;
            $("#" + tableId + "_tableHead tr:lt(" + freezeRowNum + ")").each(function () {
                if (ignoreRowNum > 0)
                    ignoreRowNum--;
                else {
                    var td = $(this).find('td:first, th:first');
                    HeadHeight += td.outerHeight(true);

                    ignoreRowNum = td.attr('rowSpan');
                    if (typeof (ignoreRowNum) == 'undefined')
                        ignoreRowNum = 0;
                    else
                        ignoreRowNum = parseInt(ignoreRowNum) - 1;
                }
            });
            //HeadHeight += 2;
            HeadHeight = HeadHeight - 8;
            divTableHead.css("height", HeadHeight);
            divTableFix != null && divTableFix.css("height", HeadHeight);
        }

        if (freezeColumnNum > 0) {
            var ColumnsWidth = 0;
            var ColumnsNumber = 0;
            $("#" + tableId + "_tableColumn tr:eq(" + freezeRowNum + ")").find("td:lt(" + freezeColumnNum + "), th:lt(" + freezeColumnNum + ")").each(function () {
                if (ColumnsNumber >= freezeColumnNum)
                    return;

                ColumnsWidth += $(this).outerWidth(true);

                ColumnsNumber += $(this).attr('colSpan') ? parseInt($(this).attr('colSpan')) : 1;
            });
            ColumnsWidth += 2;

            divTableColumn.css("width", ColumnsWidth);
            divTableFix != null && divTableFix.css("width", ColumnsWidth);
        }

        divTableData.scroll(function () {
            divTableHead != null && divTableHead.scrollLeft(divTableData.scrollLeft());

            divTableColumn != null && divTableColumn.scrollTop(divTableData.scrollTop());
        });

        divTableFix != null && divTableFix.css({ "overflow": "hidden", "position": "absolute", "z-index": "50" });
        divTableHead != null && divTableHead.css({ "overflow": "hidden", "width": width - 17, "position": "absolute", "z-index": "45" });
        divTableColumn != null && divTableColumn.css({ "overflow": "hidden", "height": height - 17, "position": "absolute", "z-index": "40" });
        divTableData.css({ "overflow": "scroll", "width": width, "height": height, "position": "absolute" });

        divTableFix != null && divTableFix.offset(divTableLayout.offset());
        divTableHead != null && divTableHead.offset(divTableLayout.offset());
        divTableColumn != null && divTableColumn.offset(divTableLayout.offset());
        divTableData.offset(divTableLayout.offset());
    }

    /* 
     * 调整锁定表的宽度和高度,这个函数在resize事件中调用 
     *  
     * 参数定义 
     *  table - 要锁定的表格元素或者表格ID 
     *  width - 表格的滚动区域宽度 
     *  height - 表格的滚动区域高度 
     */
    function adjustTableSize(table, width, height) {
        var tableId;
        if (typeof (table) == 'string')
            tableId = table;
        else
            tableId = table.attr('id');

        $("#" + tableId + "_tableLayout").width(width).height(height);
        $("#" + tableId + "_tableHead").width(width - 17);
        $("#" + tableId + "_tableColumn").height(height - 17);
        $("#" + tableId + "_tableData").width(width).height(height);
    }

    function pageHeight() {
        //if ($.browser.msie) {
        //    return document.compatMode == "CSS1Compat" ? document.documentElement.clientHeight : document.body.clientHeight;
        //} else {
            return self.innerHeight;
        //}
    };

    //返回当前页面宽度  
    function pageWidth() {
        //if ($.browser.msie) {
        //    return document.compatMode == "CSS1Compat" ? document.documentElement.clientWidth : document.body.clientWidth;
        //} else {
            return self.innerWidth;
        //}
    };

    //function initData_loaded() {
    //    $("table").each(function (x, obj) {
    //        var table = $(obj);
    //        var tableId = table.attr('id');
    //        var freezeRowNum = table.attr('freezerownum');
    //        var freezeColumnNum = table.attr('freezecolumnnum');

    //        debugger;
    //        if (typeof (freezeRowNum) != 'undefined' || typeof (freezeColumnNum) != 'undefined') {
    //            freezeTable(table, freezeRowNum || 0, freezeColumnNum || 0, pageWidth(), 400);      //pageHeight()

    //            var flag = false;
    //            $(window).resize(function () {
    //                if (flag)
    //                    return;

    //                setTimeout(function () {
    //                    adjustTableSize(tableId, pageWidth(), pageHeight());
    //                    flag = false;
    //                }, 100);

    //                flag = true;
    //            });
    //        }
    //    });
    //}

Javascript控制用户最多复制x个字

代码如下,把下面的500换成想要控制多少字节即可:

 document.addEventListener("copy", copy);
        function copy(e) {
            e = window.event || e;
            var clipboardData = e.clipboardData || window.clipboardData;
            if (!clipboardData) {
                return;
            }
            var text = window.getSelection().toString();
            if (text && text.length > 500) {
                e.preventDefault();
                clipboardData.setData("text/plain", text.substring(0, 500));
            }

 

深信服云桌面aDesk 备份挂载共享提示“请确认共享目录是否可访问,权限是否满足”

排查步骤:

1、用其他电脑访问对应的地址查看是否可以访问,是否可以ping通share服务器的ip,是否可以telnet通445

2、检查共享设备是否启用SMB功能,下图群晖设置(windows直接共享的略过)

3、检查SMB是否支持1.0,群晖等nas默认2.0-3.0(高级设置里将最小SMB协议改为1)。然后去aDesk尝试关联共享即可。