聚合问答列表
7 浏览

How do I prevent and/or handle a StackOverflowException?

I would like to either prevent or handle a StackOverflowException that I am getting from a call to the XslCompiledTransform.Transform method within an Xsl Editor I am writing. The problem seems to be ...

c#,.net,stack-overflow,xslcompiledtransform 2017-11-29
5 浏览

Convert integers to written numbers

Is there an efficient method of converting an integer into the written numbers, for example: string Written = IntegerToWritten(21); would return "Twenty One". Is there any way of doing this that d...

c#,integer 2017-11-29
5 浏览

How to send email in ASP.NET C#

I'm very new to the ASP.NET C# area. I'm planning to send a mail through ASP.NET C# and this is the SMTP address from my ISP: smtp-proxy.tm.net.my Below is what I tried to do, but failed. <%@ ...

c#,asp.net,email,smtp 2017-11-29
AD 友情赞助
7 浏览

Execute a large SQL script (with GO commands)

I need to execute a large set of SQL statements (creating a bunch of tables, views and stored procedures) from within a C# program. These statements need to be separated by GO statements, but SqlComm...

c#,sql-server 2017-11-29
6 浏览

Generics in C#, using type of a variable as parameter [duplicate]

This question already has an answer here: How do I use reflection to call a generic method? 7 answers ...

c#,.net,generics,types 2017-11-29
7 浏览

JavaScriptSerializer.Deserialize - how to change field names

Summary: How do I map a field name in JSON data to a field name of a .Net object when using JavaScriptSerializer.Deserialize ? Longer version: I have the following JSON data coming to me from a serve...

c#,json,parsing,serialization,javascriptserializer 2017-11-29
AD 友情赞助
5 浏览

Set timeout for webClient.DownloadFile()

I'm using webClient.DownloadFile() to download a file can I set a timeout for this so that it won't take so long if it can't access the file?

c#,.net,download,webclient 2017-11-29
9 浏览

How do I abort/cancel TPL Tasks?

In a thread, I create some System.Threading.Task and start each task. When I do a .Abort() to kill the thread, the tasks are not aborted. How can I transmit the .Abort() to my tasks ?

c#,.net,multithreading,task,abort 2017-11-29
6 浏览

Is floating-point math consistent in C#? Can it be?

No, this is not another "Why is (1/3.0)*3 != 1" question. I've been reading about floating-points a lot lately; specifically, how the same calculation might give different results on different archit...

c#,.net,floating-point,precision,ieee-754 2017-11-29
AD 友情赞助
6 浏览

Nested using statements in C#

I am working on a project and have to compare two files and see if they match eachother excatly. My first draft before alot of error checking and validation came up with: DirectoryInfo di = new Di...

c#,.net,file,using 2017-11-29
5 浏览

Which is preferred: Nullable<>.HasValue or Nullable<> != null?

I always used (a) Nullable<>.HasValue because I liked the semantics. However, recently I was working on someone else's existing code base where they used (b) Nullable<> != null exclusively...

c#,.net,null,nullable 2017-11-29
7 浏览

Load image from resources area of project in C#

I have an image in my project stored at Resources/myimage.jpg. How can I dynamically load this image into Bitmap object?

c#,image,winforms,load 2017-11-29
AD 友情赞助
5 浏览

Determine a string's encoding in C#

Is there any way to determine a string's encoding in C#? Say, I have a filename string, but I don't know if it is encoded in Unicode UTF-16 or the system-default encoding, how do I find out?

c#,string,encoding 2017-11-22
10 浏览

Possible to call C++ code from C#?

Is it possible to call C++ code, possibly compiled as a code library file (.dll), from within a .NET language such as C#? Specifically, C++ code such as the RakNet networking library.

c#,.net,c++,unmanaged,managed 2017-11-22
7 浏览

Design - Where should objects be registered when using Windsor

I will have the following components in my application DataAccess DataAccess.Test Business Business.Test Application I was hoping to use Castle Windsor as IoC to glue the layers together but I am ...

c#,design,inversion-of-control,castle-windsor 2017-11-22
14 浏览

Can I convert a C# string value to an escaped string literal

In C#, can I convert a string value to a string literal, the way I would see it in code? I would like to replace tabs, newlines, etc. with their escape sequences. If this code: Console.WriteLine(som...

c#,string,escaping 2017-11-22
7 浏览

An implementation of the fast Fourier transform (FFT) in C# [closed]

Where can I find a free, very quick, and reliable implementation of FFT in C#? That can be used in a product? Or are there any restrictions?

c#,signal-processing,fft 2017-11-22
7 浏览

How to ignore a property in class if null, using json.net

I am using Json.NET to serialize a class to JSON. I have the class like this: class Test1 { [JsonProperty("id")] public string ID { get; set; } [JsonProperty("label")] public string ...

c#,json.net 2017-11-22
7 浏览

Make an Installation program for C# applications and include .NET Framework installer into the setup

I've finished my C# application, but I have a little problem: When I try to run my application in another PC, I need always to Install .NET Framework 4.0. Is there something to do to make it work wi...

c#,.net,winforms,visual-studio,installation 2017-11-22
6 浏览

C# How can I check if a URL exists/is valid?

I am making a simple program in visual c# 2005 that looks up a stock symbol on Yahoo! Finance, downloads the historical data, and then plots the price history for the specified ticker symbol. I know ...

c#,validation,url 2017-11-22
AD 友情赞助