.net

How to use a FolderBrowserDialog from a WPF application with MVVM

房东的猫 提交于 2021-02-19 01:49:07
问题 I'm trying to use the FolderBrowserDialog from my WPF application - nothing fancy. I don't much care that it has the Windows Forms look to it. I found a question with a suitable answer (How to use a FolderBrowserDialog from a WPF application), except I'm using MVVM. This was the answer I "implemented", except I can't get the window object and I'm just calling ShowDialog() without any parameters. The problem is this: var dlg = new FolderBrowserDialog(); System.Windows.Forms.DialogResult result

OpenFileDialog Multiselect problem

心不动则不痛 提交于 2021-02-19 01:17:30
问题 I have standart OpenFileDialog var openFileDialog = new OpenFileDialog { DefaultExt = "mpo", Filter = "Image file |*.mpo", Multiselect = true, RestoreDirectory = true, }; and when i try to use it to open several photos on " fujifilm finepix real 3d w1 " photo camera it fires message box " Cannot open multiple items from this location. Try selecting a single item instead. " Opening only 1 file is ok. When i try to select photos from hard drive or other removable device everything is ok. Anyone

Pass socket handle from .NET to unmanaged child process

核能气质少年 提交于 2021-02-19 00:50:38
问题 I currently have a .NET program initiating a connection to a server and starting another, unmanaged executable. The native process should take over the same socket (it is essential for the connection not to be closed until the termination of the child process!) and start communicating through it with the server. The aforementioned programs run both on Windows, however I'd prefer a solution that does not involve P/Invoke for the .NET part. As a side note, communication from parent to child

Pass socket handle from .NET to unmanaged child process

▼魔方 西西 提交于 2021-02-19 00:50:35
问题 I currently have a .NET program initiating a connection to a server and starting another, unmanaged executable. The native process should take over the same socket (it is essential for the connection not to be closed until the termination of the child process!) and start communicating through it with the server. The aforementioned programs run both on Windows, however I'd prefer a solution that does not involve P/Invoke for the .NET part. As a side note, communication from parent to child

Pass socket handle from .NET to unmanaged child process

你离开我真会死。 提交于 2021-02-19 00:48:13
问题 I currently have a .NET program initiating a connection to a server and starting another, unmanaged executable. The native process should take over the same socket (it is essential for the connection not to be closed until the termination of the child process!) and start communicating through it with the server. The aforementioned programs run both on Windows, however I'd prefer a solution that does not involve P/Invoke for the .NET part. As a side note, communication from parent to child

AWS DotNet SDK Error: Unable to get IAM security credentials from EC2 Instance Metadata Service

被刻印的时光 ゝ 提交于 2021-02-18 23:28:10
问题 I use an example from here in order to retreive a secret from AWS SecretsManager in c# code. I have set credentials locally via AWS CLI, and I am able to retreive secret list using AWS CLI command "aws secretsmanager list-secrets". But c# console app fails with an error: > Unhandled exception. System.AggregateException: One or more errors occurred. (Unable to get IAM security credentials from EC2 Instance Metadata Service.) ---> Amazon.Runtime.AmazonServiceException: Unable to get IAM

Does a .NET SqlDataReader object use a database cursor, or the whole result set is loaded into RAM?

流过昼夜 提交于 2021-02-18 22:59:12
问题 Here is a sample code of using the SqlDataReader : // Working with SQLServer and C# // Retrieve all rows cmd.CommandText = "SELECT some_field FROM data"; using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { Console.WriteLine(reader.GetString(0)); } } EDIT : I mean I want to understand whether there is the same mechanism when retrieving data from database in a while-loop (in case of SqlDataReader ) as it does when working with the SQLite. // working with SQLite and Java if

Why doesn't System.Exception.ToString call virtual ToString for inner exceptions?

孤者浪人 提交于 2021-02-18 21:10:41
问题 This is the actual source for .NET's System.Exception.ToString : public override string ToString() { return this.ToString(true, true); } private string ToString(bool needFileLineInfo, bool needMessage) { string str1 = needMessage ? this.Message : (string) null; string str2 = str1 == null || str1.Length <= 0 ? this.GetClassName() : this.GetClassName() + ": " + str1; if (this._innerException != null) str2 = str2 + " ---> " + this._innerException.ToString(needFileLineInfo, needMessage) +

How to compare two .NET object graphs for differences?

无人久伴 提交于 2021-02-18 21:09:47
问题 In our Client/Server Application we've been using BinaryFormatter for the serialization process. For performance reasons we are trying to migrate to protobuf-net ( http://code.google.com/p/protobuf-net/ ). Our software transmits huge graphs with cycles between Client and Server. Now I am looking for a way to make sure that the data which was serialized and deserialized using protobuf is exactly the same as the one which was usually processed by BinaryFormatter. A bit by bit comparison is

Why doesn't System.Exception.ToString call virtual ToString for inner exceptions?

喜你入骨 提交于 2021-02-18 21:09:28
问题 This is the actual source for .NET's System.Exception.ToString : public override string ToString() { return this.ToString(true, true); } private string ToString(bool needFileLineInfo, bool needMessage) { string str1 = needMessage ? this.Message : (string) null; string str2 = str1 == null || str1.Length <= 0 ? this.GetClassName() : this.GetClassName() + ": " + str1; if (this._innerException != null) str2 = str2 + " ---> " + this._innerException.ToString(needFileLineInfo, needMessage) +