site only opens in CefSharp
zaakr.net is a site can be opened only in zaakr.exe application or through android(.apk), when opened in browser u been redirected to https://browser.zaakr.net so u download there application, (.exe) file is using cefsharp as a browser so it can access website, from 2 month i could open it from chromium as cefsharp uses chromium, now i can't access website through chromium for some reason idk, i even made a cefsharp browser myself using visual studio nothing worked all the time i been redirected to browser.zaakr.com, i want to access through any browser that have devtools available for a project, note that application zaakr.exe is still using cefsharp even the older version still can access site. i would appreciate any help, sry for any spelling mistakes, thanks.
do you know?
how many words do you know
See also questions close to this topic
-
C# - Adding condition to func results in stack overflow exception
I have a func as part of specification class which sorts the given iqueryable
Func<IQueryable<T>, IOrderedQueryable<T>>? Sort { get; set; }
When i add more than one condition to the func like below , it results in stack overflow exception.
spec.OrderBy(sc => sc.Case.EndTime).OrderBy(sc => sc.Case.StartTime);
The OrderBy method is implemented like this
public ISpecification<T> OrderBy<TProperty>(Expression<Func<T, TProperty>> property) { _ = Sort == null ? Sort = items => items.OrderBy(property) : Sort = items => Sort(items).ThenBy(property); return this; }
Chaining or using separate lines doesn't make a difference.
This problem gets resolved if I assign a new instance of the specification and set it's func, but i don't want to be assigning to a new instance everytime. Please suggest what am i missing here and how to reuse the same instance (if possible).
-
How to projection fields for a dictionary (C#, MongdoDB)
I am trying my luck here, I have a model which is like the following
public class RowData : BaseBsonDefinition { . [BsonExtraElements] [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfDocuments)] public Dictionary<string, object> Rows { get; set; } = new(StringComparer.OrdinalIgnoreCase); . }
In result, the schema in the MongoDB looks like
{ "_id": { "$binary": { "base64": "HiuI1sgyT0OZmcgGUit2dw==", "subType": "03" } }, "c1": "AAA", "c8": "Fully Vac", "c10": "", }
Those c1, c8 and c10 fields are keys from the dictionary, my question is how to dynamic project those fields?
I tried
Builders<RowData>.Projection.Exclude(p => "c1")
It seems the MongoDB driver can not handle a value directly.
Anyone could point me in the correct direction?
Thanks,
-
How do I add new DataSource to an already Databinded CheckBoxList
i'm building a web form that show Database's item(Tables, Rows, FK,...)
I have a CheckBoxList of Tables (
chkListTable
) which will show a new CheckBoxList of Rows (chkListRow
) everytime I SelectedIndexChanged fromchkListTable
. The problem is i can show the items fromchkListTable
with 1 selected item. But i don't know how to showchkListRow
if multiple item fromchkListTable
are selected.Here are my codes:
aspx
:<div> <asp:Label ID="Label2" runat="server" Text="Table: "></asp:Label> <asp:CheckBoxList ID="chkListTable" runat="server" DataTextField="name" DataValueFeild="name" AutoPostBack="true" OnSelectedIndexChanged="chkListTable_SelectedIndexChanged"> </asp:CheckBoxList> </div> <div> <asp:CheckBoxList ID="chkListRow" runat="server" DataTextField="COLUMN_NAME" DataValueField="COLUMN_NAME" RepeatDirection="Horizontal"> </asp:CheckBoxList> </div>
aspx.cs
:protected void chkListTable_SelectedIndexChanged(object sender, EventArgs e) { tableName.Clear(); foreach (ListItem item in chkListTable.Items) { if(item.Selected) { tableName.Add(item.Text.Trim()); } } for(int i = 0; i < tableName.Count; i++) { String query = "USE " + dbname + " SELECT * FROM information_schema.columns" + " WHERE table_name = '" + tableName[i] + "'" + " AND COLUMN_NAME != 'rowguid'"; chkListRow.DataSource = Program.ExecSqlDataReader(query); chkListRow.DataBind(); Program.conn.Close(); } }
Program.cs
:public static bool Connect() { if (Program.conn != null && Program.conn.State == ConnectionState.Open) Program.conn.Close(); try { Program.conn.ConnectionString = Program.constr; Program.conn.Open(); return true; } catch (Exception e) { return false; } } public static SqlDataReader ExecSqlDataReader(String query) { SqlDataReader myreader; SqlCommand sqlcmd = new SqlCommand(query, Program.conn); sqlcmd.CommandType = CommandType.Text; if (Program.conn.State == ConnectionState.Closed) Program.conn.Open(); try { myreader = sqlcmd.ExecuteReader(); return myreader; myreader.Close(); } catch (SqlException ex) { Program.conn.Close(); return null; } }
I want my display to be like this:
[x]Table1 [x]Table2 [ ]Table3 [ ]Row1(Table1) [ ]Row2(Table1) [ ]Row3(Table1) [ ]Row1(Table2) [ ]Row2(Table2)
-
C# MariaDB Update Function working in DataStore but not updating in .NET Application
My initial issue is that my database does not update when I call on this specific code. I am not sure if it is C# itself or the update query that I am calling.
string _connectionString = "validConnectionstring"; using (MySqlConnection _mySqlConnection = new MySqlConnection(_connectionString) { _mySqlConnection.Open(); using (MySqlCommand command = new MySqlCommand("UpdateProfileStatus", _mySqlConnection)) { command.Transaction = _mySqlConnection.BeginTransaction(); command.CommandTimeout = TimeSpan.FromSeconds(60).Seconds; command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@_username", "test"); command.Parameters.AddWithValue("@_status", true); command.ExecuteNonQuery(); } _mySqlConnection.Close(); }
I get no updates in my database but my console logs that the query is executed returning the value of 1 but there is no update that actually happens in my DB. Is there something in my code to reason why it is failing?
Here is the stored procedure that I have for the update command
CREATE PROCEDURE UpdateProfileStatus(_username VARCHAR(25), _status BOOL) UPDATE Profile SET status = _status WHERE username = _username;
I know the Stored Procedure works but am not sure why my .NET application is not responding to my procedure call. Is it something to do with my implementation of the parameters or is it my procedure itself?
-
How to add a new Model visually in Mac OS visual Studio
I do not see any choice to create a model in Mac visual studio? I In the windows version the Class created with its imports
using Linq
using Threading.Tasks
using Collection.Generic
-
WebView2 JS injection returns empty json string
With WebView2 for targeting Windows, I am trying to setup my own context menu. Either by selected text or by underlying element pointed by mouse click.
However, I can't get DOM element by mouse operation or even by byId. I think my JavaScript injection or WebView property setting is something wrong, but not too sure. Can anyone suggest me the resolution?
The version info.
- OS : Windows 10 Pro 21H2 19044.1682
- Visual Studio : Community 2022 17.1.6
- WebView2 : 1.0.1185.39
- Project Property: Target framework=.NET 6.0; Target OS version=10.0.19041.0
Here's the testing code
using Microsoft.Web.WebView2.Core; namespace WinFormsApp1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); HTML(@"C:\temp\test.html"); } public void HTML(string url) { webView21.CoreWebView2InitializationCompleted += WebView2Control_CoreWebView2InitializationCompleted; webView21.Source = new Uri(url); } private void WebView2Control_CoreWebView2InitializationCompleted(object? sender, CoreWebView2InitializationCompletedEventArgs e) { if (!e.IsSuccess) { MessageBox.Show($"WebView2 creation failed, with exception : {e.InitializationException}"); return; } // subscribe to events we are interested in webView21.CoreWebView2.ContextMenuRequested += CoreWebView2_ContextMenuRequested; // user clicked right mouse to show context menu } private async void CoreWebView2_ContextMenuRequested(object? sender, Microsoft.Web.WebView2.Core.CoreWebView2ContextMenuRequestedEventArgs e) { IList<CoreWebView2ContextMenuItem> menuItemList = e.MenuItems; menuItemList.Clear(); // clear default menu items, like prev, next, property //GETTING SELECTED TEXT string text = e.ContextMenuTarget.HasSelection ? e.ContextMenuTarget.SelectionText : ""; // it works if (string.IsNullOrEmpty(text)) // no text selection, then examine DOM { //GET AN UNDERLYING ELEMENT FROM MOUSE POINT var result = await webView21.CoreWebView2.ExecuteScriptAsync($"document.elementFromPoint({e.Location.X},{e.Location.Y})"); //it doesn't work, just returns an empty JSON text (not null) //var result = await webView21.CoreWebView2.ExecuteScriptAsync("function foo(){return 'foo() gets called';}; foo();"); //for testing purpose, it works //var result = await webView21.CoreWebView2.ExecuteScriptAsync("function foo(){return document.getElementById('table-content'};foo();)"); //it returns an empty result } // TO DO // setup menuItem tree based on the result we got //...... //...... e.Handled = true; } } }
-
Subprocess $Env:Path python: The filename, directory name, or volume label syntax is incorrect
I am trying to change the windows environment variables, but I am having trouble doing so.
Before I tried to use
os.environ()
I tried out using powershell commands and adding a string to$Env:Path
which worked, but removing it with:$env:Path = ($env:Path.Split(';') | Where-Object -FilterScript {$_ -ne $Remove}) -join ';'
however didn't seem to remove it being my path I want to add
("FFmpeg:C:\Users\user\AppData\"
) and adding it with+= C:/Users/etc..
didn't see, the way to go.Another way I tried to add vars through the Powershell commands was using
SetEnviormentVariable
and it seemed to work fine but once I restarted my PC the entry I made with it was gone.Sadly though all in the end all my powershell commands didn't work with subprocess. Whatever command it was I was using here I got:
PS C:\Users\Me123> python >>> import subprocess >>> subprocess.run("$Env:Path", shell=True) The filename, directory name, or volume label syntax is incorrect. CompletedProcess(args='$Env:Path', returncode=1)
-
I am working on a small project in C++ with GUI, which is about calculating the age. I want to make my program work on other computers
I am using Visual Studio 2013, I finished my project and I need to publish it, the problem is that it does not work on other computer, I think, because of the static link library or the like.I used reserved libraries in the language like
time.h
,MyForm.h
and did not use external libraries, I need solution to my problem, if there are references to something similar, mention them.EDIT: Sorry for the ambiguity in my question,
clarification: When I tried to run my program in another machine, an error message appeared, which means that the system did not recognize the file.EXE, I did not do the release, I just did Debug and then the .exe file in the Debug folder Sent it to other computers.
Sorry for bad English.
Thank you.
-
MacOS AWS EC2 bash: Cannot execute binary file on a mach-O 64-bit executable
I have a mach-O 64-bit executable that I can run locally through the terminal, but on my EC2 AWS (MacOS) I get "Cannot execute binary file". I have executable permissions on the file.
Any ideas what's wrong?
-
Published Cefsharp application not starting
I'm not sure if I'm missing something obvious. I'm pretty new to Visual Studio. My application works without any hiccups in Debug and Release. However, when I try to publish my application it doesn't even start. I can install it and the desktop shortcut is placed properly, however the application refuses to start.
And I've checked if the process is still running in the background (process starting but nothing happens) but this is not the case either. The process is never started when trying to open the application.
I'm not even sure what kind of information I need to provide you guys with. I read somewhere that I need the "app.manifest" in my project, which I do have. Other than that I haven't seen any other prerequisites or instructions on how to publish a Cefsharp application specifically.
Thankful for any help!
Here is my app.manifest, in case there's something wrong with it.
<?xml version="1.0" encoding="utf-8"?> <asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <assemblyIdentity version="1.0.0.0" name="AGV_Dashboard.app" /> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> <!-- UAC Manifest Options If you want to change the Windows User Account Control level replace the requestedExecutionLevel node with one of the following. <requestedExecutionLevel level="asInvoker" uiAccess="false" /> <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> <requestedExecutionLevel level="highestAvailable" uiAccess="false" /> Specifying requestedExecutionLevel node will disable file and registry virtualization. If you want to utilize File and Registry Virtualization for backward compatibility then delete the requestedExecutionLevel node. --> <requestedExecutionLevel level="asInvoker" uiAccess="false" /> </requestedPrivileges> </security> </trustInfo> <asmv3:application> <asmv3:windowsSettings> <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness> <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware> </asmv3:windowsSettings> </asmv3:application> <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application> <!-- A list of all Windows versions that this application is designed to work with. Windows will automatically select the most compatible environment.--> <!-- Windows 7 --> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" /> <!-- Windows 8 --> <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" /> <!-- Windows 8.1 --> <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" /> <!-- Windows 10 --> <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" /> </application> </compatibility> <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) --> <!--<dependency> <dependentAssembly> <assemblyIdentity type="Win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/> </dependentAssembly> </dependency>--> </asmv1:assembly>
-
Get loaded page source in CefSharp webbrowser
I'm wanting to get source code of a web page based on Angular (so cannot use HttpClient or WebClient, page source completes after running JS), tried to use CefSharp (v.100) but cannot find a way to get page source. I found
EvaluateScriptAsync
andwebBrowser.Document
but no one works in version 100.[Update] I need to get a resource link from source, or even if I can do it via RequestHandle to get a resource link which requested after Angular rendering.