/
k64t34
/
RemoteGroupExecution
Обзор
Документация
Войти
/
k64t34
/
RemoteGroupExecution
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
RGE/HTMLBlock.cs
68 строк
2 KB
K64t
GetFiles
26 фев 2021, 23:30
26 фев 2021, 23:30
f1a54d4
Код
Авторство
О чём код?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class HTMLBlock1 { //public String InnerHtml; String TagId; public HTMLBuilder.TagBuilder Label; public HTMLBuilder.TagBuilder Div; public HTMLBlock1(String TagId) { this.TagId = TagId; Label = new HTMLBuilder.TagBuilder("label"); Label.InnerHtmlBlock.Add(TagId); Label.Attribute.Add("for",TagId); Label.Attribute.Add("id", "l."+TagId); Div = new HTMLBuilder.TagBuilder("div"); Div.Attribute.Add("id","d."+TagId); } public override string ToString() { StringBuilder Output = new StringBuilder(); Output.Append("<input type=\"checkbox\" id=\"" + TagId + "\" class=\"PC\"/>"); Output.Append(Label.ToString()); Output.Append("\n"); //if (Div.InnerHtmlBlock.Count!=0) Output.Append(Div.ToString()); Output.Append("<BR>\n"); return Output.ToString(); } } /* <input type="checkbox" id="m16" class="PC"/> <label for=m16>m16<span class="OK"> OK </span></label> <div> Ping <span class="OK"> OK </span><BR> Copy script D:\Users\Andrew\Project\RemoteGroupExecution\RGE\bin\Debug\xcopy01.cmd to remote host \\m16\c$\xcopy01.cmd<span class="OK"> OK </span><BR> Run remote script </div> cancellationToken.ThrowIfCancellationRequested(); local_result = false; var subBlock = new PCHTMLBlock(Host + ".WMI"); subBlock.Label.InnerHtml("Execute remote script "); try { ...Do something ... local_result = true; subBlock.Label.InnerHtmlBlock.Add(HTMLSpanOK()); } catch (Exception e) { subBlock.Label.InnerHtmlBlock.Add(HTMLSpanFAULT()); subBlock.Div.Add(e.Message); } finally {block.Div.Add(subBlock.ToString()); } if (local_result) { ...Continue... } */