.net

C# WebRequest to php script carry out insert statements problems

Okay basically /// <summary> /// Sends the process. /// </summary> /// <param name="MD5">The M d5.</param> /// <param name="procName">Name of the proc.</param> /// <param name="procLoc">The proc loc.</param> public void SendProcess(string MD5, string procName, string procLoc) { ...

Anyone have experience using .NET based Glorsoft Velocity for IVR Development?

Glorsoft Velocity is .Net based but I don't see a developer forum around it. it is difficult to tell how well it is being adopted. Product looks good to me but I only want to use a technology only if has a following and user group around it. Anybody using it? If so, how is it going for you? ...

Authentication with OpenRasta

I'm trying to use OpenRasta for a simple RESTful service. This service needs to be secured with either http Basic authentication or (preferably) Digest. Looking around the net, there are tens of webpages writing how wonderful OpenRasta is and that it even supports Digest authentication but I haven't been able to find a single example of...

EF eqivalent for rows affected of SqlCommand.ExecuteNonQuery

In an approval workflow I want to ensure that reminder emails are sent exactly once. With SqlCommand.ExecuteNonQuery I can ensure this by testing the return value. What is the recommended solution using EF? According to the documentation ObjectContext.SaveChanges does not return an equivalent value. SqlCommand example: (The Transaction...

SQL Server 2008: INSERT if not exits, maintain unique column

I'm using SQL Server 2008. I've got a column NVARCHAR(MAX) in a table which I want to make sure is unique. The table has 600,000 records and grows every day by 50,000 records. Currently before adding an item to the table I check if it exists in the table and if not I insert it. IF NOT EXISTS (SELECT * FROM Softs Where Title = 'exampl...

How to prohibit comma as decimal separator

I'm writing code with german culture settings Nevertheless I would like to force the user to use the point as a decimal separator. My piece of test code outputs the wrong value. How do I detect the "wrong" comma ?(throw an exception) string nok_str = "14,9"; string ok_str = "14.9"; double nok_Var1 = double.Parse(nok_str, CultureInfo...

How should I store my custom classes?

I've gotten to the point where I have made a few classes that I have found to be rather useful for a variety of different projects, they're either extensions of the already existing .Net ones or something entirely new. Although I may not use them for EVERY project I would most certainly use them again at some point, my questions is what...

.NET Parallel.ForEach, StreamWriter output + thread safe

Hi, In the past I have used ThreadPool.QueueUserWorkItem to spawn multiple threads from a manager class. This manager class subscribes to an event in these spawned threads which is raised when the thread work completes. The manager class can then handle writing output to a text file by using a lock to prevent any race conditions. Now I...

Encrypting a file with 3 passwords [SOLVED]

Hi. This is kind of an unusual problem. I am having difficulty encrypting a file using 3 passwords. I am attempting to wrap one CryptoStream around two other CryptoStreams, but when I write the file to the disk, it seems to become corrupted, and the padding cannot be completely removed. Why would this be happening? EDIT: This was SOLVED....

c# send image to php script, php script loop through $_FILES array

Okay so i have code that uploads images WebClient client = new WebClient(); client.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); client.UploadFile("Address/upload.php", "POST", @"C:\Test\test.jpg"); For example, the file name will be dynamic and could be anything, so how do i send an image to server and then save ...

SQL Server 2008 - HashBytes computed column

Hello, I'm using SQL Server 2008. I have a NVARCHAR(MAX) column called Title and i want to add an unique index for it. Because the column is bigger than 900bytes , I decided to create a HashBytes computed column (based on recommendation on StackOverflow). How do i create the HashBytes column? alter table Softs add TitleHash AS (has...

Linq's Aggregate Function, How to make a CSV String

I'd like to make a comma seperated value string with Linq's Aggregate function. Anyone know how to do this? Given an array of strings like this: var authors = new string[] {"author 1", "author 2", "author 3"}; How do I get a single string like this author 1, author 2, author 3? I'm thinking something like authors.Aggregate(author => ...

How do I solve 'The specified module could not be found' while the .dll is in the application directory already?

Hi All, I developed a winforms application in C# 4.0 that uses a .dll to communicate with a USB device. From Visual Studio 2010 this application works without problem. The referenced .dll is copied to the bin folder. When I tried to run the application directly on the target machine it didn't do anything. I've added an unhandled except...

How to list linux running process from C#.net client ?

I want to read all the running process in linux server from my C#.net client ? Can you please show me the way or possibility for achieving this ? We are in same domain.. I guess no firewall issue and but I cannot write or install anything on server. (I am trying this to get hold of the process id running on linux box and when that pr...

How do I get the line number and path of a method from a pdb using .Net?

Given an assembly and its pdb, how do I get the line number and path to a method using .Net? ...

Call a computer with another computer (Dial up Modem)

Hi. is it possible to call Computer A with Computer B in Same Country via theirs dial up modems? i mean use computer as telephone (with Dial Up modem) i no need transferring voice just : 1) Computer A Dialing Computer B (with the Phone number) 2) Computer B is see that computer A is calling. 3) Computer B Answer. please putting sample c...

Html Browser: best practice to pass user SID to server-side

Legacy application (win32 clients + centralized db) has 40+ installations in a company & lacks the ability to be extended by plugins. Legacy authentication system relies on computer name, user name & user SID (there is no single DOMAIN server in a company, there are dozens of workgroups). I'm going to build stand-alone intranet site th...

InvokeRequired is true on PictureBox. How to deal with this?

I had another question on my PictureBox calls giving me 3 kinds of errors, some great answers came in particularly from Conrad Frix. So it led me to figure out where my problem is, but now to fix it I am not 100% sure on. Basically I have a Windows Form timer that is checking for some event to be true, if it is, then it tells the sys...

NHibernate slow startup, conditional loading of HBMs and "Association references unmapped class"

Background We have several projects / applications running off the same model. They all have their own unique entities / tables, but also share 1 specific, common entity / table. I.e. Entities required by application A, will never be required by application B, except for the common table, and vice versa. Now the common table has relatio...

License key library for C# windows application that is open source / free

Any recommendations for an open source (free) C# library/application for a C# Windows Application that could be used for: (a) creating license/product keys and (b) has library that can be used within the code to perform a check to see whether the entered license key is valid? (I've seen other posts which cover commercial products, but h...