.net

Why overloading does not occur?

I have the following class: class CrmToRealTypeConverter : IConverter { #region IConverter Members public object Convert<T>(T obj) { return Convert(obj); } #endregion private DateTime? Convert(CrmDateTime obj) { return obj.IsNull == false ? (DateTime?)obj.UserTime : null; } priva...

win forms solutions deployment issue - access violation error

Hi all I have developed an solutions that has a few projects inside, if I build the solutions if works success in debug and in release mode, I have created installation a setup project, the installation goes smooth but the program throws an exception when it tries to talk with a com dll. in debug mode I had the same issue till I added i...

Blocking Application from being Executed

Ihave a C function which blockes exe applications from being Executed, and i like to do the same with window form .net2. How? int ExecuteBlocking(const char *appName, const char *cmdLine) { char sz[260]; STARTUPINFO siStartupInfo; PROCESS_INFORMATION piProcessInfo; memset(&siStartupInfo, 0, sizeof(siStartupInfo)); memset(&piProcess...

SQL Backing up with SMO & C# ?

I'm using the following code to back up a SQL Database : void BackupDatabase(string sConnect, string dbName, string backUpPath) { using (SqlConnection cnn = new SqlConnection(sConnect)) { cnn.Open(); dbName = cnn.Database.ToString(); ServerConnection sc = new ServerConnection(cnn); Server sv = ne...

WPF Ribbon's application menu alignment: bug or programmer error?

I'm using WPF 4's (in .NET 4) ribbon control, version 3.5.40729.1, in my application. (Edit: I also tested the newly released version 4.0.0.11019 to no avail.) The application menu and all sub-menu popups align as far left as possible, usually far outside the ribbon window. The expected location is that the application menu's left edge a...

How can I reduce boilerplate in my properties using attributes?

I'm playing around with Sqlite and Attributes, and I have properties throughout my code that look like this: const string FooKey = "foo"; ... string m_foo; [DatabaseColumn (FooKey)] public string Foo { get { return m_foo; } set { if (m_foo == value) return; m_foo = value; OnFooChanged (); /...

asp.net redirecting to login page

If I have set the forms authentication timeout to 30 days (in minutes) and I have set the session timeout to 5 mins and I am using a cookie to persist the different session variables .. why does asp.net or IIS always always issue a 302 and redirects to the login page when the session times out ? (Doing http debugging it puts an "object ...

handling execptions on tasks on .net 4.0

i'm getting an odd execption on task creation in .net 4.0. i'm getting the exectpion on windows service with a Global Updomain unhandled execptions handler so i don't have the exact stack-"A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property." i think it occurs on the following code se...

Where to find great resources on ASP.net Architecture, Web Site Architecture?

I've recently become heavily involved in a few projects that are going to work as company-wide intranet systems. They will basically be intranet websites, replacing older legacy systems that are desktop-based. I'd like to research the best ways to set-up these web site, or web application projects. Most notably, I'm looking for: Diff...

WCF losing values when using a static

I have a WCF that has a static class. I use this to store login information. To my great surprise I am finding that at different times the wcf static is losing values. What could cause this? What is the best way to persist information in a WCF service? In memory is the best because it is faster... ...

Example of simple port forwarding using any UPnP library in Java?

I want to open port 5555 on my machine using UPnP to the world. Could you please provide me with such Java sample for any sutable Opensource library. I need A CODE SAMPLE like one I can give you for C# using this lib using TCMPortMapper; private void Form1_Load() { PortMapper.SharedInstance.Start(); PortMapping pm = new PortMapping...

How can I search for strings with characters not on the keyboard (non-english)?

I have a search form that I want my users to be able to enter English character equivalents for non-English characters. For example. To find Ælfred, the user could search for "Ælfred" or "AElfred". the search should also be case insensitive so "aelfred" would work. I also have it searching so that, by default, it matches the beginning o...

How to remove bytes from a byte array

Hello, I have a program that has a byte array that varies in size, but is around 2300 bytes. What I want to do is create a function that will create a new byte array, removing all bytes that I pass to it. For example: byte[] NewArray = RemoveBytes(OldArray,0xFF); I need a function that will remove any bytes equal to 0xFF and return m...

HRESULT: 0x80040154

I create win application by vs2008 and use dsoframer.ocx to view word document. this application work ok in my machine,but when i created setup file and installed it in another pc windows xp sp3 i recieved error:HRESULT: 0x80040154 ...

Problem with struct's constructor (compiler is yelling that I didn't fully initialize all the struct's auto-properties)

I have the following bit of code: public struct Interval { public double Min { get; set; } public double Max { get; set; } public Interval(double min = double.MinValue, double max = double.MaxValue) { Min = min; Max = max; } } The compiler is complaining that Backing field for automatically i...

Arraylist of custom classes inside My.Settings

I have a Visual Basic .Net 2.0 program. I'm moving the settings from an older settings file, to an app.config program settings file. I'm trying to do this as nicely as possible. So, I added my setting as shown in this image. On load I do this: If My.Settings.databaseConnectionSettings Is Nothing Then My.Settings.database...

Can you create a webbased UI using .Net?

I have a WPF application, that I want to convert to an application running from the browser. The reason is that WPF doesnt run on Mac/Linux, and Silverlight is not an option because of it's security restrictions. The basic idea is to turn the app into a webserver-like application, and handle the UI completely in html/ajax. This 'webserv...

Securing .Net Winforms Application with hardlock dongle or a digital certificate

I'm developing a C# Winforms application for a customer. The customer wants the program secured by a hardlock, so only people having the appropriate hardlock can access the program. I know there are a ton of ways to secure accessing to a Winforms application, but he inststs on using a hardlock. I have never experienced implementing a ...

Why does Java apps need an application server and .Net just IIS Web Server?

Why is there so much confusion in the java world with various servers like apache, tomcat, jboss, jetty, etc and in .Net world it is just IIS that does that job. I would like to understand the need and use of it and am not starting a java vs. .net. ...

Are there any ELMAH-style exception logging components for non-http applications?

ELMAH is purpose-built for logging exceptions in ASP.Net, which is fine, but it does leave a lot of people (myself included) wanting to solve the same all-encompassing exception logging/viewing problem for non-web applications. Do you know of any open source components for general purpose exception logging and reporting in the vein of E...