小编Tha*_*amy的帖子

如何在C#中使用LDAP在Active Directory中添加新组

我有场景使用LDAP和C#在Active Directory中创建新组.

请提供建议

ldap active-directory c#-4.0

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

ImportError:在__init__.py文件Python中导入类时没有名为''的模块

我是python编程的新手.我创建了一个名为kitchen的包.我想通过__init__.py文件导入一个类文件.

我是python版本:3.3.2

OS平台:windows

Fridge.py

class Fridge:   
    def __init__(self, items={}):
        """Optionally pass in an initial dictionary of items"""
        if type(items) != type({}):
            raise TypeError("Fridge requires a dictionary but was given %s" %
    type(items))
        self.items = items
        return

    def _Get_Items(self):
        print(self.items);

    def _Get_Added_Values(self,lst):
        values =0;
        print(len(lst));
        for index in lst:
            values += index;
        return values
    def _Get_Seperetor(self,str1,lst):
        str1=str1.join(lst);
        return str1;


    def _Get_Keys(self):
        print(self.items.keys());
Run Code Online (Sandbox Code Playgroud)

Courses.py文件

class Courses:
    def __init__(self, items=[]):
        """Optionally pass in an initial dictionary of items"""
        if type(items) != …
Run Code Online (Sandbox Code Playgroud)

python import

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

SyntaxError:用于验证本地文件路径的未终止括号

我必须验证本地文件夹路径,其格式如下:..\sentinel\log.

对于C:\ sentinel\log,我有旧的正则表达式(/[\w]:\.*/)).我需要接受这条道路.

我从regexplibrary得到以下表达

var pathRE = new RegExp("/^((../ | [a-zA-Z0-9 _/ - \])*.[a-zA-Z0-9])"); 错误:SyntaxError:未终止的括号

当我执行时抛出此错误

我附上了我尝试过的代码

function checkFolderpath(path) {
    try {
        //var pathRE = new RegExp(/[\w]:\\.*/);
        var pathRE = new RegExp("/^((\.\./|[a-zA-Z0-9_/\-\\])*\.[a-zA-Z0-9])");
        if (pathRE.test(path)) {
            $("#spanloggererror").html("");
            return true;
        }
        else {
            $("#spanloggererror").html(resx_Invalid_Loggerpath);
            valtemp = 1;
        }
        return false;
    }
    catch (err) {
        alert(err.Message);
    }
Run Code Online (Sandbox Code Playgroud)

请建议我如何解决这个问题.

编辑:

路径值:..\Sentinel\log

javascript regex jquery

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

标签 统计

active-directory ×1

c#-4.0 ×1

import ×1

javascript ×1

jquery ×1

ldap ×1

python ×1

regex ×1