.net

Any good Wizard libraries for Winforms?

I'm looking for a good "Wizard" library for Winforms. WYSIWYG editor preferrable, but not a must. ...

Generic type casting method (.Net)

I'm trying to create a generic method to cast an object, but can't seem to crack that chestnut. (It's Friday 3pm, been a long week) Ok, so I have this scenario: // We have a value (which .net sets as a double by default) object obj = 1.0; // We have the target type as a string, which could be anything: // say string sometType = "Syste...

Fastest way to separate the digits of an int into an array in .NET?

I want to separate the digits of an integer, say 12345, into an array of bytes {1,2,3,4,5}, but I want the most performance effective way to do that, because my program does that millions of times. Any suggestions? Thanks. ...

How to create a context that you can access?

Is it possible to create a context that is accessible from a set of windows but not from a different set? For example, two web request are running in their own context and objects like ServiceSecurityContext.Current are pointing to different instances. My application is a Word like application with a PlanWindow that open a plan documen...

Typemock and Dependency Injection, still use interfaces?

Hi I see some good design benefits in DI and not just good testability design. So even though I have Typemock and could unit test without IOC, I still prefer constructor DI. I think it's a great way to quickly discover the dependencies of a class. Now I'm wondering should I keep using interfaces as the type parameter in the constructor...

Can you tag a section of code to be included only in the Debug build?

Sorry for the extreme newbie question, but I couldn't find the answer elsewhere and haven't actually ever done anything like this myself (go figure -- I guess that happens when your company uses the production environment for testing). It would be nice if Visual Studio offered some mechanism for specifying that certain segments of code ...

WCF client (Add Service Reference) hates WebGet and WebInvoke...really, it does

I have been working to create WCF services that will operate independent of .Net clients. Thanks to Google and StackOverflow, I have been able to create both simple xml and json services without Soap wrappers and a bunch of fancy WCF stuff that I just don't need. It has been a painful experience, hence the subject line of this question...

How to serialize attached properties

Hello everyone, I am writing .NET3.5, WPF application using Composite Application Library. Application is divided into several modules. In infrastructure module I have defined NetworkNode object. The Network module manages a collection of NetworkNodes and uses XmlSerializer to store/load this collection. So far everythings works. But...

C# - WCF - inter-process communication

What is the best WCF binding to use for inter-process communication? I have used WCF over local networks and it is amazing, and I'd like to use it for inter-process communication as well. I do not want to expose the communication over the network, however. ...

Ask ActiveDirectory if a machine is a member of a group

This should be really easy but for some reason it doesn't seem to be. I want to ask AD if the current machine is a member of a particular group. Direct membership is fine. Group only contains 8 PC's and is extremely unlikely to grow beyond 30. C# code examples appreciated! ...

Multi-threaded application interaction with logger thread

Hi there, folks. Here I am again with questions about multi-threading and an exercise of my Concurrent Programming class. I have a multi-threaded server - implemented using .NET Asynchronous Programming Model - with GET (download) and PUT (upload) file services. This part is done and tested. It happens that the statement of the proble...

Can we have generalized connection string for SQL Server and SQL Server Express?

I have a WCF service that is deployed on a machine. This WCF service can be configured to either SQL Server or SQL Server Express. NOTE : The SQL database location can be other machine other then where WCF service is deployed. I put following information in XML file: user id password ServerName MachineName In case of SQL Server Ex...

convert ticks to time_t or Filetime()

how do i convert ticks to time_t or filetime(). Please suggest thanks ...

Odd Error in SharpZipLib -- Size was x, but I expected y

I'm getting an error when I use the SharpZipLib. I have code that looks like FastZip compressor = new FastZip(); compressor.CreateZip(outputFileName, currentWorkingDirectory, true, ""); Which seems to be correct. However, I get a ZipException claiming that size was 0, but I expected 54 I have no idea what that means. Anyone have...

Truncate string on whole words in .Net C#

Hi, I am trying to truncate some long text in C#, but I don't want my string to be cut off part way through a word. Does anyone have a function that I can use to truncate my string at the end of a word? E.g: "This was a long string..." Not: "This was a long st..." Thanks, Tim ...

Using ScrollBars in .Net

Is there any way to Use the Builtin ScrollBars that comes with each .Net ScrollableControl without setting the AutoScroll Property to Enable? Here is the issue, even If I Enable, set to Visible and declare min and max values as well as the smallChange and LargeChange for the HorizontalScrollBar and VerticalScrollBar they show up in the b...

.NET Click-Once and Dial-up, DSL, Cable Detection

Is there a good simple way to detect if a user is using Dial-up, DSL or Cable from a .NET Click-Once application? This is for Intranet through VPN or Extranet purposes not a public app on the Internet. ...

System.Net.Mail Alternative

I'm working on a tool that schedules emails with our mail server in C#. I had been using the System.Net.Mail classes to send the mail. Recently I've come across various issues with regards to RFC violations and other issues, such as SmtpClient not ending the SMTP session according to protocol. Each of these problems is counting toward a...

Running a simple .NET web page

I create a simple project in .NET and this is what I get when I try to run the program. This is the URL that is being generated. Everythig was running and all of a sudden I am getting this issue. What might be the problem here. I am running firefox but doensn't work in IE7 either. I can access other site with no problem just when I try t...

Help with database schema for 50+GB DB

Hi all, I have a task to store large amount of gps data and some extra info in database and to access it for reporting and some other non frequent tasks. When I recieve a message from gps device it can have variable number of fields. For example Message 1: DeviceId Lat Lon Speed Course DIO1 ADC1 Message 2: DeviceId Lat Course DIO2 ...