.net

Programmatically logging in to a website

How does one log in to a website programmatically? I just want to check that the provided username and password of a website is correct or not. Thanks. ...

Displaying the value of a reference to an object

In C++ it is fairly simple to display the actual value of a pointer to an object. For example: // hope this makes sense: (please edit if not) void* p = New CSomething(); cout << p; Is there a way to do something like this in .NET? The value of doing this would/could only be educational, e.g. for purposes of demonstration as in displa...

Using xCode in a .net application

I have a mac application(written with xcode) i have to write a .net application that uses this code. what is the best practice in this case? ...

How is JIT compiled code injected in memory and executed?

"Consider a typical Windows x86 or AMD64 architecture, the memory is divided in executable sections that cannot be written to and data sections that can be written to but cannot be executed (think DEP)." "JIT compiles methods in-memory, does (generally) not store anything to disk, instead moves it around where the...

WPF 2-Way Databound DataGrid

Can anyone point me to a very simple example(C#4.0) of a WPF Datagrid thats bound to a SQL table. I'd really like the simplist example possible. I want to be able to add, edit and delete rows. Thanks. ...

Sending Automatic E-mails

Hi Guys, I want to send an automatic E-mail based on the date. If the current date is greater than 5 days than the current date field in the table then i need to send an E-mail to the designated person. I am using VS.NET2003/VB.NET/ASP.NET/SQL Sever 2000. Can you guys help me how to get this done(if possible with Code?) Thanks. ...

C# Double - ToString formatting to show a value in cents with no decimal displayed.

I have a situation where I need to display a double value rounded to two decimal places, but displayed without the decimal. There will be some situations where I will want to use the same code and display the double value differently, so I was hoping I could handle this by passing in a string format pattern. For example, the double val...

What are the theoretical implications of unbounded lookbehind?

Most languages allow fixed-length or finite-length lookbehind. One notable exception is .NET, which allows the use of the * operator. However, .NET regexs can already recognize balanced parentheses using named capture, which is not a regular language. Are regexs still regular with * in lookbehind? Extended answers for subexpressions ...

SQLDatareader via CLR not returning SQL Message right way

I execute the following code via CLR, is there a reason why the message is not printed to the SQL Server, does it need to wait until the Stored Procedure returns all the rows (there is about 7 Billion rows to return) SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedu...

Automated Testing OpenXML SDK

Hi, I'm implementing ms word document generation using content controls and OpenXML SDK. I'd like to have some automated testing for that code (unit tests or some easy UI automation tests). Does anyone has expericnce with testing MS Word document generation? What are the possible options? Thanks in advance! ...

Entity Framework 4.0 - Get By ID Using Generics and Reflection

I am looking to be able to load an entity by ID using generics and property reflection but am unsure how to accomplish this task using Entity Framework 4.0. I have a method in my abstract method as such: public abstract T GetById(object id, TestContext context); Currently, since it is abstract, I have to implement this method in ever...

Can I use a full version of Visual Studio 2010 to develop Windows 7 Phone Apps instead of the download package

I have Visual Studio 2010 Professional as well as Expression Blend 4 loaded on my development machine already. Everything I read says to develop apps for the Windows 7 Phone, I need to download the vm_web.exe file which includes Visual Studio 2010 for the phone and the emulator as well as a stripped down version of Expression Blend. Wh...

How to serialize/deserialize simple classes to XML and back

Sometimes I want to emulate stored data of my classes without setting up a round trip to the database. For example, let's say I have the following classes: public class ShoppingCart { public List<CartItem> Items {get; set;} public int UserID { get; set; } } public class CartItem { public int SkuID { get; set; } public ...

Is it good practice to return an IEnumerable<T> for a collection that implements INotifyCollectionChanged

Writing another question for SO, I came to a pattern that I use very often and I never really reflected about. But now, I’m no longer sure if this is the right way: If I have collections that my WPF-controls will bind to, I returned almost always IEnumerable<SomeType>. However internally , this is in most cases an ReadOnlyObservableColl...

Property/Method Descriptions for COM Libraries

If you create a COMClass, I've noticed that the values in the XML Summary tag do not show in the object browser of VB6/VBA when you reference the resulting tlb file. Is there a way to have these values show up? ...

Need help understanding how the List<T>.Sort(IComparer(T)) knows the value to sort on

I am working on a program (learning C#) that creates a object (Card) and in the program it sorts the deck of cards by value. What I am baffled by is how it is able to sort a deck of cards by the value of the cards when the instance of the object isn't the parameter passed to the method but the class object. Below is the code to help an...

Question about events in vb.net

I've been thinking about my options when it comes to events in vb.net. What I'd like to do is to track events that are fired in an application without explicitly declaring them with 'handles' sub. Here is a pseudo-code: Private Sub HandlesAllEvents(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles all.events Selec...

deobfuscator for .Net

Do you know any good deobfuscator for .Net? ...

Determine Primary Keys of an Entity using the Context in Entity Framework 4.0

I have several entities generated from my Entity Framework data model. In the .edmx file I can see the properties that are flagged as primary keys. My POCO's/custom context are generated from this and the T4 templates. I am looking for a way to find out the primary keys of my entities using reflection with Entity Framework 4.0. Is there...

C# IPC Recommendations and comparisons

I've been working in .net for a few years, and this is my first foray into IPC. I know of the various possibilities for doing IPC (Named Pipes, Remoting, Clipboard Managment, Win32API messaging), but I don't know whats "right for me". I plan on using the following setup: Site Object: This is the reason the ipc is needed. It will be ...