聚合问答列表
4 浏览

Can't get Czech characters while generating a PDF

I have a problem when adding characters such as "Č" or "Ć" while generating a PDF. I'm mostly using paragraphs for inserting some static text into my PDF report. Here is some sample code I used: var ...

c#,asp.net,pdf,unicode,itextsharp 2017-11-30
3 浏览

How To Represent 0.1 In Floating Point Arithmetic And Decimal

I am trying to understand floating point arithmetic better and have seen a few links to 'What Every Computer Scientist Should Know About Floating Point Arithmetic'. I still don't understand how a num...

c#,floating-point,double,decimal,bit-representation 2017-11-30
3 浏览

Generating random, unique values C#

I've searched for a while and been struggling to find this, I'm trying to generate several random, unique numbers is C#. I'm using System.Random, and I'm using a datetime.now.ticks seed: public Rando...

c#,.net,random,unique 2017-11-30
AD 友情赞助
5 浏览

how can i get text formatting with iTextSharp

I am using iTextSharp to read text contents from PDF. I am able to read that also. But I am loosing text formatting like the font, color etc. Is there any way to get that formatting as well. Below is...

c#,.net,itextsharp 2017-11-30
4 浏览

C# variable scoping: 'x' cannot be declared in this scope because it would give a different meaning to 'x'

if(true) { string var = "VAR"; } string var = "New VAR!"; This will result in: Error 1 A local variable named 'var' cannot be declared in this scope because it would give a different ...

c#,scope 2017-11-30
3 浏览

The name 'controlname' does not exist in the current context

I have a web application that I'm working on (ASP.NET2.0 with C#, using VS2005). Everything was working fine, and all of a sudden I get the error: Error 1 The name 'Label1' does not exist in the c...

c#,asp.net,visual-studio-2005,code-behind 2017-11-30
AD 友情赞助
2 浏览

C#: Difference between ' += anEvent' and ' += new EventHandler(anEvent)'

Take the below code: private void anEvent(object sender, EventArgs e) { //some code } What is the difference between the following ? [object].[event] += anEvent; //and [object].[event] += ...

c#,delegates,event-handling 2017-11-30
3 浏览

Change DataGrid cell colour based on values

I have got a WPF datagrid and I want diffrent cell colours according to values. I have got below code on my xaml Style TargetType="DataGridCell" but instead of selecting a cell only is selecting al...

c#,wpf,xaml,colors,datagrid 2017-11-30
4 浏览

Big integers in C#

Currently I am borrowing java.math.BigInteger from the J# libraries as described here. Having never used a library for working with large integers before, this seems slow, on the order of 10 times slo...

c#,biginteger,largenumber,j# 2017-11-30
AD 友情赞助
5 浏览

Why doesn't .NET/C# optimize for tail-call recursion?

I found this question about which languages optimize tail recursion. Why C# doesn't optimize tail recursion, whenever possible? For a concrete case, why isn't this method optimized into a loop (Visua...

c#,.net,optimization,tail-recursion 2017-11-30
3 浏览

Distinct not working with LINQ to Objects

class Program { static void Main(string[] args) { List<Book> books = new List<Book> { new Book { Name="C# in Depth", ...

c#,.net,linq,iequatable,iequalitycomparer 2017-11-30
4 浏览

Checking for directory and file write permissions in .NET

In my .NET 2.0 application, I need to check if sufficient permissions exist to create and write to files to a directory. To this end, I have the following function that attempts to create a file and w...

c#,.net,winforms,directory,file-permissions 2017-11-30
AD 友情赞助
3 浏览

How do foreach loops work in C#?

Which types of classes can use foreach loops?

c#,foreach 2017-11-30
4 浏览

How do I split a string by a multi-character delimiter in C#?

What if I want to split a string using a delimiter that is a word? For example, This is a sentence. I want to split on is and get This and a sentence. In Java, I can send in a string as a delimiter...

c#,.net,string 2017-11-30
2 浏览

Controling Volume Mixer

I want to control other application volume(firefox). i can do it with Volume Mixer What is the libraries of the Volume Mixer?

c#,.net,vb.net,winforms 2017-11-30
3 浏览

Why is Multiple Inheritance not allowed in Java or C#?

I know that multiple inheritance is not allowed in Java and C#. Many books just say, multiple inheritance is not allowed. But it can be implemented by using interfaces. Nothing is discussed about why ...

c#,java,language-design,multiple-inheritance 2017-11-30
3 浏览

How to save/restore serializable object to/from file?

I have a list of objects and I need to save that somewhere in my computer. I have read some forums and I know that the object has to be Serializable. But it would be nice if I can get an example. For ...

c#,serialization,stream 2017-11-30
4 浏览

LINQ to Entities case sensitive comparison

This isn't a case-sensitive comparison in LINQ to Entities: Thingies.First(t => t.Name == "ThingamaBob"); How can I achieve case sensitive comparison with LINQ to Entities?

c#,.net,entity-framework-4,linq-to-entities 2017-11-30
3 浏览

Creating a Generic type instance with a variable containing the Type

Is it possible to achieve the following code? I know it doesn't work, but I'm wondering if there is a workaround? Type k = typeof(double); List<k> lst = new List<k>();

c#,generics,types,instance 2017-11-30
3 浏览

A potentially dangerous Request.Path value was detected from the client (*)

I am receiving the rather self explanatory error: A potentially dangerous Request.Path value was detected from the client (*). the issue is that my url contains a *: https://stackoverflow.com/Searc...

c#,asp.net,url,routing,webforms 2017-11-30
AD 友情赞助