.net

how can i get connection bandwidth used per process under windows os?

i would like to know about software that can do this and if it is possible to be programmed under the .net framework. please dont post irrelevant software! thank you ...

Castle ActiveRecord: Save is throwing StaleStateException

Following this question, I tried to convert a sequence of try..Insert()..catch..Update() into a single call to Save(). I'm getting StaleStateException with "Unexpected row count: 0; expected: 1". What am I doing wrong? Here is the code that fails: var u = new User {SignupDate = DateTime.Now, Name="Foo", OpenId = "Bar"}; ActiveRecordMe...

How to determine the current windows user from a windows service?

I'm writing a Windows Service using C# .NET 2005. How can I determine who the currently logged-on user is (if any)? Also is there a way to be notified when a user logs on? Alternatively, is there a way to know who has recently used the machine? I need to know the currently logged on user so I can cache some data for that user. Operatin...

Cut files to clipboard in C#

Hi, I'm looking for a way to programmatically cut a file to the clipboard, e. g. some call to a function in C# that does the same as selecting a file in the Windows Explorer and pressing Ctrl+X So after running the program and pressing Ctrl+V in some other folder on the hard drive, the original file would be MOVED to the new folder. By l...

How to hash only image data in a jpg file with dotnet?

I have a ~20000 jpg images, some of which are duplicates. Unfortunately, some files have been been tagged with EXIF metadata, so a simple file hash cannot identify the duplicated one. I am attempting to create a Powershell script to process these, but can find no way to extract only the bitmap data. The system.drawing.bitmap can only r...

What is the best datatype for storing a blogpost in SQL Server?

I´m using SQL Server and programming a blogtool. I want to store texts longer than 4000 chars and a want it to be fast searchable. Is ntext the right datatype to use? ...

Possible Threading, Variable copy issue

We have an application that runs a routine like: protected string _largeFile; Execute() //this executes in basically an infinite loop. { _largeFile = ""; DoStuff(); DoStuff(); _largeFile = "ReallyBigString"; //sometimes 4-5Mb if(_largeFile != "") { RaiseEvent(); } DoStuff(); DoSTuff();...

How to find out how many concurrent connections to WCF service exists?

Hi everybody I need to determine how many users are connected to a WCF service. I am using the NetTcpBinding. Thank you. ...

Do we have transactions in MS-Access?

I am developing a small desktop application using C#.NET and MS-Access. I don't have any prior experience of MS-Access. I want to know if we can use transactions in Ms-Access or not. I have the below mentioned situation. Insert in Tbl1 Insert in Tbl2 I want to insert in tbl2 only when insertion in tbl1 is successful. And if there ...

.NET HttpWebRequest HTTPS Error

Hello I'm trying to fetch data from a https web (i'm not behind firewall or proxy) however even accepting all certificates it keeps throwing System.Net.WebExceptionStatus.SecureChannelFailure with the message shown: Cancelled the request: Unable to create a secure SSL/TLS channel ... i've looked everywhere so you guys are my last chance....

MySQL data provider for .net

Do we have any Open Source MySql Data Provider for .net? If Any, Let me know. ...

Avoid boxing in DbParameter.Value?

Hi I'm using ADO.NET to communicate some db, and searching for a way to avoid boxing when setting the DbParameter.Value property to value-type. Is there a way to avoid boxing in DbParameter.Value? Thanks. ...

List<> OrderBy IComparer ?

Hi guys, I have a List<ListViewItem> and I've used it in a ListView in VirtualMode There are 5000 items in the list and I'm gonna sort it with LINQ and OrderBy whenever a Column of the ListView is clicked , so I have written below code : List<ListViewItem> ListOfItems = new List<ListViewItem>(); ListViewColumnSorter lvwColumnSorter; ...

How do you wrap and access the config files from your applications?

Well, the question speaks for itself. I use to have a static Config class in my project that lazy-load the data from the config file like this : private static string _foo; public static string Foo { get { if (string.IsNullOrEmpty(_foo)) _foo = ConfigurationManager.AppSettings["fo...

Access text file from web with VB .Net

I'm trying to load a text file with VB .Net so that I can use it with a streamreader object. for example: www.fakesite.com/text.txt Thanks It is of a particular URL and is already present on the server ...

The maximum size for file that can be read in .net

What's the maximum size of file that can be read in .net Framework ? It's the long(Int64) max because it's the type of the offset in the Seek method in all reader ? ...

How to set software restriction policies programatically

I would like to add software restriction policies programatically using c#. For example: Add and additional rule to disallows paint.exe to run. Unfortunately I don't have the slightest idea how I could achieve this in c# Thx in advance, Tom ...

Strange section in web.config

Hi, I noticed this in my web.config: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> </dependentAsse...

unable to delete image after opening it in vb.net app

I have this code: Dim xx as image xx = image.fromfile(Fileloc) picturebox.image = xx And i can't delete the file even though I've loaded it into a picture box. If I add this line: xx.dispose the picture box becomes a big red X. I only want to delete the images when my application is closing (they are temp files). So shall I just...

Protecting code in COM objects

Hi, how can I protect my business logic C# code that I have written in a COM object from being reverse engineered by a high tech geek? ...