.net

Where can i find a .net implementation of atof?

Is there an implementation for the c language's atof function in the .net world? float.Parse does not behave the same. Some behavioral differences. "50 Apple" will return 50. "50 Apple. 1" will return 50. "Apple" will return 0. ...

Ambiguous Call with a Lambda in C# .NET

I have a class with an overloaded method: MyClass.DoThis(Action<Foo> action); MyClass.DoThis(Action<Bar> action); I want to pass a lambda expression to the Action version: MyClass.DoThis( foo => foo.DoSomething() ); Unfortunately, Visual Studio rightly cannot tell the difference between the Action<Foo> and Action<Bar> versions, due...

C# - New to Windows Forms Applications and in need of help

Let's consider this scenario: a freshly create windows form application in which i created a Form2 besides the original Form1. 1st Question: I want both forms to show up at start-up, so i basically wanted to add Application.Run(new Form2()); in main right after the similar command for Form1, but since i read that i cant use multiple thr...

better DateTime.Parse out there?

Does anyone know of a library (paid or not) out there that is able to handle more common datetime formats than DateTime.Parse uses? Something that can handle multiple languages and abbreviations for days/months would be really nice. For example: "Sept 1, 2009" does not work with Datetime.Parse. ...

Generics and Duck-Typing XML in .NET?

I'm working with some XML representations of data instances. I'm deserializing the objects using .NET serialization but something in my soul is disturbed by having to write classes to represent the XML... Below is what I'd LOVE to do but I don't know if the syntax or if it is even possible: Consider the following: dim xmlObject = Som...

How to know if there is any PDF reader on the client PC

Hi everyone, I need to know if there is any way to detect in a client PC (Windows) there any PDF reader (Adobe Reader, Foxit Reader, ...), using VB6 and. NET (C #). I can not do by reading the Windows registry, because the user may not have permissions to read it. Thank you. ...

Why would an iterator (.Net) be unreliable in this code

I have an example that I can get to break every time I use an iterator, but it works fine with a for loop. All code uses variables local to the executing method. I am stumped. There is either a fact about iterators that I am not aware of, or there is an honest to goodness bug in .Net. I'm betting on the former. Pleae help. This code rel...

Constraints, generic variables and arithmetic operators

I’d like to declare a generic class Simple where a method called Addition would take two generic variables and add them together using + operator. I thought I could accomplish this by giving class Simple the following constraint: class Simple<T> where T: int { public T Addition(T firstInt, T secondInt) { return firstInt...

How to read a private key from pvk file in C#?

Hi, I have to read a private key, and this key is on pvk format. I use X509Certificate2 class, but i this class i have only public key access. How can i get a private key from pvk file? thanks Luiz Costa ...

mcafee scan comes with Encrypted SSL cookie error

I have this as a vulnerability issue in McAfee scan for my website (ASP.NET with VB.Net, IIS7, SQL Server 2008)- Missing Secure Attribute in an Encrypted Session (SSL) Cookie. What do i have to do to get rid of this vulnerability? please advice ...

Problem using MSBuild's Copy task (VS2005TS Team Build)

My project's manager assigned me to maintain the builds, but it's my first contact with MSBuild, so things are being somewhat hard, as most first contacts. :) I've been struggling to get MSBuild/Team Build to copy some files to my project's "bin" folder, but had no sucess until now. The files are kept on a folder that we use as a reposit...

EventHandler delegate accepts methods with the following signature, but event implementing EventHandler doesn’t

Assuming we declare a class DerivedEventArgs: public class DerivedEventArgs : EventArgs { ... } then EventHandler delegate is able to accept methods with the following signature: public static void Some_Method(object o, DerivedEventArgs e) { ... } But if we try to subscribe a method with the above signature to the event implementin...

How to get properties from anonymous type in VB.NET

I am trying to figure out how to get at an anonymous typed object's properties, when that anonymous type isn't created in the current function. Specifically, I am binding an ASP.NET ListView to LINQ resultset, then trying to process each item in the ItemDataBound event. Option Explicit On Option Strict On Class MyPageClass Privat...

Dataset/Datatable to Excel Template File .net

I know there are a lot of questions on how to write data from a dataset or datatable to excel, but they all seem to assume a new blank excel workbook. I have a special excel file containing multiple sheets with lots of formatting, formulas, and a chart. I just need to lay data over the appropriate portions of some sheets and let excel ha...

Report Viewer or Gridview/Datalist/Repeater

I want to display data in format Store Name Department1 User1 2 3 5 6 User2 2 3 5 6 User3 2 3 5 6 User4 2 3 5 6 Department2 User1 2 3 5 6 User2 2 3 5 6 User3 2 3 5 6 User4 2 3 5 6 Store Name1 Department1 User1 2 3 5 6 User2 2 3 5 6 User3 2 3 5 6 User4 2 3 5 6 Department2 User1 2 3 5 6 User2 2 3 5 6 User3 2 3 5 6 User4 2 3 5 6 WHich...

C# Winform Binary Icon

I want to change the icon my binary has for my applications. The people I work with aren't technologically savvy and quite literally changed AppName.exe to CLICK ME.exe because they didn't know which icon to click... Anyway, I figure an easy solution to this is to just make all of my applications for them have the same, bright icon so ...

Workflows for .net 2.0

Exists any good software and sdk to make workflow and use it in c# .net 2.0? My idea is create a workflow using application like visio and next convert metadata from file to a database and populate some workflow tables. I tried use Visio but Interop is very complicated and not work very well. Anyone have a idea or get a free/open sour...

Using Json.NET converters to deserialize properties

I have a class definition that contains a property that returns an interface. public class Foo { public int Number { get; set; } public ISomething { get; set; } } Attempting to serialize the Foo class using Json.NET gives me an error message like, "Could not create an instance of type 'ISomething'. ISomething may be an inter...

Options for Big Arrays in .NET with over 2^31 keys.

Are there any built it options for arrays supporting more than 2^31 keys. This would make keys of type System.Int64 rather than System.Int. While 2^31 is a fair amount, there are a growing number of of applications where more keys would help. For instance, there are over 3 billion base pairs in the human genome. Any easy options? ...

Acessing netstat-like data with .NET

Hi there, I'd like to know if there is any way to access info like number of discarded packets from within .NET framework. I am aware of Win32_PerRawData and Ip Helper API. Thanks in advance ...