.net

cURL Proxy Identification

I was wondering if I can use cURL in my .Net application to authenticate to a proxy and then connect with a browser without the annoying authenticate window popping up?? Thanks! ...

Save WebBrowser Control Content to HTML

I have a WebBrowser Control and have called the Navigate(url) function of it for a given file. Then I have manipulated the DOM tree by giving new Id's to some of the tags. Now I want to save the result in an HTML file. I have tried to use the webBrowser.DocumentStream, but it seems that this stream won't change after manipulating the DO...

Is there a Ruby on Rails framework like equivalent for .NET development?

Answers like ASP.NET MVC or Entity Framework really aren't acceptable as they address just one aspect of the problem domain. I'm looking for a framework ... a REAL framework that gives me the same features out of the box that Rails does. As such it should include at minimum: MVC for presentation ORM Ability to provide simple configur...

Adding a DataGridView in IronPython Studio Winforms gets a "'DataGridView' object has no attribute 'BeginInit'"

By just adding a datagridview in IronPython Studio it triggers a "DataGridView' object has no attribute 'BeginInit'". Is there a fix for this? The errors are gone if the lines self._DataGridView1.BeginInit() and self._DataGridView1.EndInit() are deleted, but that's not what it should be done to fix that ...

Moq and the parameters you pass

I create a MOQ object pass it to my class call it and pass in an object. How can I get access to this object to see if the right properties are set? ...

Push Brush Stroke Through Stack?

Hello, Im trying to create a undo function for a image editor but I having troubles. What Im trying to do is push each brush stroke through a stack then use stackName.Pop() to undo but I can't seem to add the brush stroke to the stack. Here is my code: Stack undoStack = new Stack(); bool mouseDown = false; private void pictureB...

Hex Pair to Hex Shorthand

I have a bunch of Color objects (.Net). I want to convert them to Hex, which is simple enough with something like: Dim clr As Color = Color.FromArgb(255, 0, 0) Dim clrString = ColorTranslator.ToHtml(clr) Is there a way in .Net or through RegEx (or some other way) that I can determine if Hex shorthand (like #F00) is available for the s...

Storing settings/variables persistantly in C#/.NET

Ok, this is a total newb question, so please forgive me. What is the best way to store variables so that they persist and are recoverable? I have a small application that uses about 10 variables (string and decimal) as settings. Currently, I convert them all to strings, if needed, put them into an array and serialize the array to a file...

How do I pass a parameter to the IValueConverter in code behind file.

I have a Dictionary<string,List<string>> I need to present in a SilverLight DataGrid. One column is the key value and the other is the values in the list. The reason for this is due to my object having more than one attribute of the same type assigned to it. The key is the name of the attribute from the db suffixed with number so the dic...

Curl Proxy Authentication Persisting

Hi, I was wondering if a I can log into a proxy and authenticate with CURL, but have those credentials persist in a cookie? Thanks! ...

How to resolve ambigiously named extension method?

I have a DataTable that I'm trying to enumerate over with the AsEnumerable extension method on System.Linq.Enumerable. The problem is that there is an identically named extension method on System.Data.DataTableExtensions. I need to use both namespaces in my class so removing one of the using statements is not an option. How do I decl...

Getting a double[] row array of a double[,] rectangular array

Suppose you have an array like: double[,] rectArray = new double[10,3]; Now you want the fouth row as a double[] array of 3 elements without doing: double[] fourthRow = new double[]{rectArray[3,0], rectArray[3,1], rectArray[3,2]}; Is it possible someway? Even usin...

What is the difference between System.Speech.Recognition and Microsoft.Speech.Recognition?

There are two similar namespaces and assemblies for speech recognition in .NET. I’m trying to understand the differences and when it is appropriate to use one or the other. There is System.Speech.Recognition from the assembly System.Speech (in System.Speech.dll). System.Speech.dll is a core DLL in the .NET Framework class library 3.0 an...

LINQ Numerical Grouping

Looking for a way to group in sets of n elements with LINQ. I.e: {1,2,3,4,5,6,7,8,9}: Grouped By 2: {{1,2},{3,4},{5,6},{7,8},{9}} Grouped By 3: {{1,2,3},{4,5,6},{7,8,9}} Grouped By 4: {{1,2,3,4},{5,6,7,8},{9}} Etc... Only way I can think of doing something like this at the moment is by using an anonymous type to generate a group in...

MSI not running the current version of the code in .NET Setup project.

I'm not sure what happened, but my installer is in a weird state--when I install my MSI, it doesn't seem to be running the current version of the code (I'm using Custom Actions). I verified it by placing some MessageBox.Shows and sure enough, they are not popping up. It's possible I may have had a few unsuccessful installs previously...

WCF "Instance already exists in CounterSet" error when reopening ServiceHost

I have a working ServiceHost with a single NetTcpBinding and a single endpoint. I .Close() it. Then, I create a new ServiceHost instance with the exact same configuration as the first one. Then, when I try to .Open() the new instance I'm getting this very awkward exception: System.ArgumentException occurred Message=Instance 'LobbySer...

What is the best way to wrap some text in an xml tag?

I am trying to use Regex in C# to match a section in an xml document and wrap that section inside of a tag. For example, I have this section: <intro> <p>this is the first section of content</p> <p> this is another</p> </intro> and I want it to look like this: <intro> <bodyText> <p> this is asdf</p> <p> yada y...

Any mature SaaS CMS solution out there

Hi all, Looking for mature SaaS CMS solution out there that has a .NET api or RESTful api. The minimum requirement are: A nice interface for content editing The ability to sync content across servers (dev/staging/production) Versioning (rollback) Workflow Role based permission (all other cms goodies) ...

C# Class (source code) Generator from XML file

What tools have you used to create class source code from xml files? Is this an edge case that I need to roll my own? I have need to create DTOs from some XML files, but the XML files are subject to change (add/remove attributes) so I need to be able to quickly update them. I'm reallly not impressed with the .xml -> .xsd -> bloated .cs ...

How to find offending column? Can't Convert from string to int32

Hi I am using SqlBulkCopy. So I made a datatable and specifed it's columns then added rows to the datatable and then try to insert it. System.InvalidOperationException was unhandled by user code Message=The given value of type String from the data source cannot be converted to type int of the specified target I keep gett...