public bool ChangePassword(string username, string oldpass, string newpass) { web = new WebEngine("Nokia 7110/1.0"); this.Login(username, oldpass); this.ChangePass(oldpass, newpass); return true; }
public SMFEngine(Dictionary<string, string> options) { this.web = new WebEngine(); this.options = options; if (options.Keys.Contains("ignoressl") && options["ignoressl"] == "true") { AccountManagementEngine.ignoreSSL(); } }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.Configure <CookiePolicyOptions>(options => { // This lambda determines whether user consent for non-essential cookies is needed for a given request. options.CheckConsentNeeded = context => true; options.MinimumSameSitePolicy = SameSiteMode.None; }); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); //add NopConfig configuration parameters services.ConfigureStartupConfig <NopConfig>(Configuration.GetSection("Nop")); WebEngine webEngine = new WebEngine(); webEngine.Initialize(services); }
static void Main(string[] args) { CommandModel.CommandsFlags cmdFlags = new CommandModel.CommandsFlags(); Parser.Default.ParseArguments <Options>(args) .WithParsed <Options>(o => { if (o.Cmd != string.Empty) { switch (o.Cmd.ToLower()) { case "start": cmdFlags = CommandModel.CommandsFlags.StartCleaning; break; case "stop": cmdFlags = CommandModel.CommandsFlags.StopCleaning; break; case "charge": cmdFlags = CommandModel.CommandsFlags.ChargeCleaning; break; } } if (o.RequestFile != string.Empty) { fInfo = new FileInfo(o.RequestFile); } }); if (cmdFlags != CommandModel.CommandsFlags.None) { if (fInfo.Exists) { string cmdString = string.Empty; string requestFileText = File.ReadAllText(fInfo.FullName); CommandModel requestFileModel = JsonConvert.DeserializeObject <CommandModel>(requestFileText); if (cmdFlags == CommandModel.CommandsFlags.StartCleaning) { cmdString = requestFileModel.StartCleaningCommand; } if (cmdFlags == CommandModel.CommandsFlags.StopCleaning) { cmdString = requestFileModel.StopCleaningCommand; } if (cmdFlags == CommandModel.CommandsFlags.ChargeCleaning) { cmdString = requestFileModel.ChargeCleaningCommand; } QihooRequest request = new QihooRequest { cookie = requestFileModel.Cookie, body = cmdString }; HttpWebResponse response = new HttpWebResponse(); WebEngine.Request_q_smart_360_cn(request, out response); } else { Console.WriteLine("Request-file not found. Please check path."); } } }
void WebBrowser_DocumentCompleted(object sender, System.Windows.Forms.WebBrowserDocumentCompletedEventArgs e) { string webRoot = Path.Combine(Directory.GetCurrentDirectory(),"SampleWebApp"); engine = new WebEngine(WebBrowser.Document, webRoot); }