public FirefoxTarget(FirefoxConnection connection, FirefoxBrowser firefoxBrowser, IBrowserContext context, string targetId, TargetInfoType type, string url, string openerId) { _connection = connection; _browser = firefoxBrowser; _targetId = targetId; _openerId = openerId; BrowserContext = context; Type = type switch { TargetInfoType.Browser => TargetType.Browser, TargetInfoType.Page => TargetType.Page, _ => throw new ArgumentOutOfRangeException(nameof(type)) }; Url = url; }
public static void setTargetInfo() { GroupConfigServiceClient client = new GroupConfigServiceClient(); AuthHeader authHeader = new AuthHeader(); HeaderUtil.loadHeader(authHeader); TargetInfoType parameters = new TargetInfoType(); parameters.groupId = 3066066L; //取值范围: //1表示回头客定向, //2表示关键词定向, //3表示不启用受众行为, //4表示到访定向 parameters.type = 2; KtItemType ktItem = new KtItemType(); ktItem.aliveDays = 30; ktItem.targetType = 5; KeywordType[] wordList = new KeywordType[3]; KeywordType word = new KeywordType(); word.keyword = "鲜花"; word.pattern = 0; wordList[0] = word; word = new KeywordType(); word.keyword = "百合"; word.pattern = 1; wordList[1] = word; word = new KeywordType(); word.keyword = "玫瑰"; word.pattern = 0; wordList[2] = word; ktItem.ktWordList = wordList; parameters.ktItem = ktItem; String result = null; ResHeader resHeader = client.setTargetInfo(authHeader, parameters, out result); Console.WriteLine("GroupConfigService.setTargetInfo(): "); ObjectDumper.WriteResponse(resHeader, result); }
public NtlmTargetInfo(TargetInfoType targetType) { Info.Type = targetType; }
public NtlmTargetInfo(TargetInfoType targetType, string targetContent, Encoding contentEncoding) : this(targetType, contentEncoding.GetBytes(targetContent), contentEncoding) { }
public NtlmTargetInfo(TargetInfoType targetType, byte[] targetContent) : this(targetType, targetContent, Encoding.Unicode) { }
public NtlmTargetInfo(TargetInfoType targetType, byte[] targetContent, Encoding contentEncoding) : this(new TargetInfoStruct { Type = targetType }, targetContent, contentEncoding) { }