聚合问答列表
43 浏览

What is App.config in C#.NET? How to use it?

I have done a project in C#.NET where my database file is an Excel workbook. Since the location of the connection string is hard coded in my coding, there is no problem for installing it in my system,...

c#,.net,app-config 2018-01-23
43 浏览

byte[] array pattern search

Anyone know a good and effective way to search/match for a byte pattern in an byte[] array and then return the positions. For example byte[] pattern = new byte[] {12,3,5,76,8,0,6,125}; byte[] toBeS...

c#,pattern-matching 2018-01-23
40 浏览

Reflection: How to Invoke Method with parameters

I am trying to invoke a method via reflection with parameters and I get: object does not match target type If I invoke a method without parameters, it works fine. Based on the following code if ...

c#,reflection,parameters,methods,invoke 2018-01-23
AD 友情赞助
59 浏览

Accessing Imap in C# [closed]

Is there a built-in method to access an Imap server (with SSL) in C# or is there a good free library?

c#,imap 2018-01-23
44 浏览

Show a Form without stealing focus?

I'm using a Form to show notifications (it appears at the bottom right of the screen), but when I show this form it steals the focus from the main Form. Is there a way to show this "notification" form...

c#,.net,winforms 2018-01-23
37 浏览

Launching an application (.EXE) from C#?

How can I launch an application using C#? Requirements: Must work on Windows XP and Windows Vista. I have seen a sample from DinnerNow.net sampler that only works in Windows Vista.

c#,.net,windows-vista,windows-xp 2018-01-23
AD 友情赞助
84 浏览

C# Ignore certificate errors?

I am getting the following error during a web service request to a remote web service: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication...

c#,.net,ssl 2018-01-23
48 浏览

Getting image dimensions without reading the entire file

Is there a cheap way to get the dimensions of an image (jpg, png, ...)? Preferably, I would like to achieve this using only the standard class library (because of hosting restrictions). I know that it...

c#,.net,image,image-manipulation 2018-01-23
35 浏览

How to Load an Assembly to AppDomain with all references recursively?

I want to load to a new AppDomain some assembly which has a complex references tree (MyDll.dll -> Microsoft.Office.Interop.Excel.dll -> Microsoft.Vbe.Interop.dll -> Office.dll -> stdole.dl...

c#,.net,reflection,assemblies,appdomain 2018-01-23
AD 友情赞助
28 浏览

How to do joins in LINQ on multiple fields in single join

I need to do a LINQ2DataSet query that does a join on more than one field (as var result = from x in entity join y in entity2 on x.field1 = y.field1 and x.field2 = y.field2 I ha...

c#,linq,join 2018-01-23
36 浏览

How do you perform a left outer join using linq extension methods

Assuming I have a left outer join as such: from f in Foo join b in Bar on f.Foo_Id equals b.Foo_Id into g from result in g.DefaultIfEmpty() select new { Foo = f, Bar = result } How would I express ...

c#,linq-to-sql,lambda 2018-01-23
39 浏览

Keeping ASP.NET Session Open / Alive

Which is the easiest and most unobstrusive way to keep an ASP.NET session alive as long as the user has the browser window open? Is it timed AJAX calls? I want to prevent the following: sometimes user...

c#,asp.net,session 2018-01-23
AD 友情赞助
48 浏览

How can I change the table names when using Visual Studio 2013 ASP.NET Identity?

I am using the release version (RTM, not RC) of Visual Studio 2013 (downloaded from MSDN 2013-10-18) and therefore the latest (RTM) version of AspNet.Identity. When I create a new web project, I selec...

c#,asp.net,asp.net-membership,asp.net-mvc-5,asp.net-identity 2018-01-23
110 浏览

SqlException from Entity Framework - New transaction is not allowed because there are other threads running in the session

I am currently getting this error: System.Data.SqlClient.SqlException: New transaction is not allowed because there are other threads running in the session. while running this code: public cla...

c#,entity-framework,transactions 2018-01-23
49 浏览

OdbcConnection returning Chinese Characters as “?”

I have an Oracle database that stores some data values in Simplified Chinese. I have created an ASP.net MVC C# webpage that is supposed to display this information. I am using a OdbcConnection in orde...

c#,oracle,odbc 2018-01-23
76 浏览

Memory Leak using StreamReader and XmlSerializer

I've been googling for the past few hours and trying different things but can't seem to the bottom of this.... When I run this code, the memory usage continuously grows. while (true) { try ...

c#,xml,streamreader,xmlserializer 2018-01-23
33 浏览

.NET Process.Start default directory?

I'm firing off a Java application from inside of a C# .NET console application. It works fine for the case where the Java application doesn't care what the "default" directory is, but fails for a Java...

c# 2018-01-23
34 浏览

How do I determine the owner of a process in C#?

I am looking for a process by the name of "MyApp.exe" and I want to make sure I get the process that is owned by a particular user. I use the following code to get a list of the processes: Process[...

c#,.net,process 2018-01-23
36 浏览

How to write Unicode characters to the console?

I was wondering if it was possible, in a console application, to write characters like ℃ using .NET. When I try to write this character, the console outputs a question mark.

c#,.net,vb.net,console-application 2018-01-23
32 浏览

Why is the console window closing immediately without displaying my output?

I've decided to study some basic C# (though I have experience when it comes to programming) the thing is I am following the guides in MSDN, but the issue here is that their Hello World Program is show...

c#,.net,console-application 2018-01-23
AD 友情赞助