.net

.NET how to output csv from enumeration of anonymous type?

Using FileHelpers, I decorated a class with [DelimitedRecord(",")] and was going to output an enumeration of objects of that type as CSV. But, it didn't work because my class inherits from ActiveRecordLinqBase<T>, which caused some problems. So, I was wondering if I could just select an enumeration of anonymous types and somehow have f...

File Locked by Services (after service code reading the text file)

I have a windows services written in C# .NET. The service is running on a internal timer, every time the interval hits, it will go and try to read this log file into a String. My issue is every time the log file is read, the service seem to lock the log file. The lock on that log file will continue until I stop the windows service. At ...

Reading from an USB barcode scanner

Hi, I've got this nice USB barcode scanner and I'd like to readthe input using the USB driver and not the keyboard input. How can this be accomplished using .NET? any ready libraries? I couldn't find anything of real use... Thanks! ...

Entity Framework 4 Self Many-To-Many with Properties

UPDATE: Solved by myself. Tricky but works. If you know a better solution, feel free to correct me. DESIGNER: CODE: Product product1 = new Product{key = "Product 1"}; sd.AddToProducts(product1); Product product2 = new Product{key = "Product 2"}; sd.AddToProducts(product2); Product product3 = new Product{key = "Product ...

build single file application

Hello. I am trying to merge two files. One of them is .net3.5 wpf application and other is WPF notify icon dll i use the following command: IlMerge /target:winexe /out:PS.exe "PlayerSearcher.exe" "Hardcodet.Wpf.TaskbarNotification.dll" But when i launch result assebmly my application is crashed with this error EventType : clr20r3...

Getting .net remoting to support IP v4 and v6: how to get a stream mapped to a real ip, not just an argument exception

My company has an existing .Net Remoting service exposing interfaces to external processes. I am configuring this service to support both IP v4 and IP v6 communications by having the following app.config section: <system.runtime.remoting> <application> <service> <wellknown mode="Singleton" type="type, ...

Ultrawingrid - how to display #1/1/1800# as blank ( as if null )

Ultrawingrid 9.2 VS2008 .net 3.5 My wingrid uses a bindingsource. All datetimes which are null in SQL Server are delivered to the bindingsource as #1/1/1800# I would like Ultrawingrid to display this date as blank as it would a null from source. Also, if the date is null in the grid ( i.e. blanked out ) I would like to update the dat...

How to Create a Duotone Interpolation Color in GDI+ (.NET)?

I have two colors that I need to linearly interpolate to create a duotone color based of another color's luminance value. Dim clr1 = Color.Black Dim clr2 = Color.FromArgb(224, 255, 165) Dim lum = Color.FromArgb(226, 189, 136).GetBrightness 'lum = 0.71 I know the result of this should be R=171, G=192, B=125, but I can't figure out how ...

Entity Framework 4 mapping fragment error when adding new entity scalar

I have an Entity Framework 4 model-first design. I create a first draft of my model in the designer and all was well. I compiled, generated database, etc. Later on I tried to add a string scalar (Nullable = true) to one of my existing entities and I keep getting this type of error when I compile: Error 3004: Problem in mapping fra...

VB.NET - 'Title' is not a member of 'Calendar.Appointment'

I am having a problem with my code. I am using VB.NET and Visual Studio 2010 to write my program. The source of the control that I am using can be found here. First, I imported the Calendar.DayView.dll file into my toolbox to use as a control. Then I added the following code to my existing code: Private Sub DayView1_NewAppointment(ByVa...

is it possible to programmatically check the service provider for a cell number?

is there a database or API available where i can enter a cell phone number and it will spit out whoever the providor is like tmobile or verizon? ...

Win32_PageFileUsage WMI call returning 0 for CurrentUsage

I am querying for the current page file usage on Windows-based systems. This is meant to run on the .NET Framework, version 2.0 SP1 and has been tested (and works!) on Windows Vista, Windows 7, Windows Server 2003 R2 and Windows Server 2008. On Windows Server 2003 SP2 (original release, not R2) it appears to return 0: using (var query...

Mimicking basic fcntl or SetHandleInformation call in .Net

Tornado enables win32 support by faking Python's fcntl function using SetHandleInformation, which is available via ctypes on Windows. After some other small fixes, this actually works using IronPython on Windows as well (sadly, IronPython is five times slower). I'd like to get Tornado working on any CLI platform, such using Mono on O...

tcp/ip accept not returning, but client does

server: vxworks 6.3 calls the usual socket, bind, listen, then: for (;;) { client = accept(sfd,NULL,NULL); // pass client to worker thread } client: .NET 2.0 TcpClient constructor to connect to server that takes the string hostname and int port, like: TcpClient client = new TcpClient(server_ip, port); This is working fine whe...

MS Chart, X axis dates and cursor interaction when X value is indexed.

Good afternoon, Wow what a title. Basically here is the thing. If have a time series which is not continuous. Hence, since I use the IsXValueIndexed property of the Series (set to true) to collapse the space between the separate points. That works fine, however I would now like to be able to recover a point's detail in from the grap...

How to make an application like google transliteration desktop application in c#

Just the functionality of intercepting the keyboard entry , transforming it and sending it back is required.eg if user press a i wold like to send e etc. To make a application that accepts the entry from keyboard modify it and send it to the active window (may be application like word, excel,notepad windows screens ) etc. The feature i...

Threading in C#

Hi All Just looking for something ultra simple. I need to spawn a method off to a new thread. I don't care when or how it ends. Can somebody please help me with this? Thank you ...

.Net Com Interop: Return bool for a wrapped function that returns BOOL

I have COM function that returns BOOL -- which is simply a typedef for int -- and I'm generating a .Net wrapper using Visual Studio. Is there a way I can have the wrapper automatically convert the BOOL to the C# bool type and return that? ...

How to suppress email validation when using SmtpClient and MailMessage

When sending out emails using the SmtpClient and a MailMessage (.net 3.5) the "To" email address(es) get validated prior to sending. I've got a big stack of email addresses which have a dot (.) before the at-sign, causing a FormatException when you attempt to send the message using the SmtpClient. This is actually a good thing, because b...

.NET XML Serialization, possibly to use a different method name than PropertySpecified for ignoring properties?

I have a bunch of classes that I intend to serialize in order to transport over a webservice call. These classes already have properties that return whether a given "real" property has a value or not, that is ingrained in a lot of code of our product. Is it possible, for instance through attributes, for me to specify that each "real" p...