.net

What's a good strategy for renewing the expiration of a forms auth ticket between .net and php?

I'm creating an application that will get the contents of a cookie storing a forms authentication ticket from .net. That part is done. In that ticket is an expiration time, by default 20 minutes. So the scenario is, a user logs in and is validated on the .net side. Then they are redirected to my PHP app. I get the username, ticket expi...

wtsapi32.WTSQuerySessionInformation() Failing on x64

Hi All, I'm trying gather Terminal Server session information on 64-bit Windows machines. My question is two fold. First, on 32-bit machines we called the following function, which worked fine. Private Declare Function WTSQuerySessionInformation Lib "wtsapi32" _ Alias "WTSQuerySessionInformationA" _ ...

What is the best way to expose my server's API?

I have a .NET Windows service that needs to expose an API. I am using remoting now during development process. Right now all my methods accept and return XML. I already have a lot of custom serialization and deserialization code for the needed objects. None of these objects are very large. I want to make my API available to many lang...

How to use Generic Handlers (ASHX) in ASP.NET MVC?

I need a image generator in my ASP.NET MVC application, but I don't know if it is possible to use ASHX in ASP.NET MVC. If there is an class similar to IHttpHandler that inherits IViewDataContainer, then I could use ViewData.Model on my ASHX. I read a blog post about it but it seem outdated from the info I got in the ASP.NET forum Any ...

Explain how delegates work in the following code?

I am curious on how the following code works, especially the part the contains the delegate stuff since I am new to it. Also, are there any bottlenecks in the code, for example, would using a SortedDictionary be better than using a List and then sorting it using LINQ? Ok, here is the code: public class ColorManager { private List<...

How do you get started with Mono curses?

Hi, I am trying to create an interactive command line program and it seems that Mono-Curses is what i need. but I am very confused on how to use it. I have a couple of questions. What do i really need to create my project? Do I need mono or can i use the .net framework? Why is there a .c file in there and what do I do with it? If anyo...

Should I write my own GridView implementation?

I haven't worked with GridView too much and after poking around with it, find it to be more complex than I need but missing some very basic abilities that I would expect it to have. No doubt its implementation makes sense given its 90% of the time purpose of being bound to a dataset especially when doing this declaratively, but I intend...

redirecting to POST HttpWebRequest

Hey Folks, I'm trying to POST data to an external url using HttpWebRequest, then i need to redirect the user to the external url where which i just POSTed my data, can this be achieved on the first place ? ...

Problem with discriminators in Linq to SQL

I'm trying to use a discriminator field in my linq to sql setup. I have a base class called Inventory_Item which I have setup to be abstract and then many different services that inherit from it (e.g. BaseWash). Now the properties for the BaseWash association are Base Class Discriminator Value = 1 Derived Class Discriminator Value = ...

Replacements for Full Text Search

I am not a big fan of Full Text search with MSSQL(not sure if there is another) does anyone know of any other options to this? ...

What are some good resources on using Lucene.Net?

Does anyone know where I can find out more information on Lucene.Net? I am looking for a tutorial or videos on how to use Lucene.Net that stack overflow users can personally recommend. ...

How to deal with a flaw in System.Data.DataTableExtensions.CopyToDataTable()

Hey guys, so I've come across something which is perhaps a flaw in the Extension method .CopyToDataTable. This method is used by Importing (in VB.NET) System.Data.DataTableExtensions and then calling the method against an IEnumerable. You would do this if you want to filter a Datatable using LINQ, and then restore the DataTable at the e...

Find or Create Element in LINQ-to-XML

I want to set the value/children of an element that may or may not already exist. If the element doesn't exist, I want to have it automagically created for me. This way, my code only has to worry about the contents of the element... not whether or not it already exists. (By the time I'm done with it, it's guaranteed to exist). Does th...

JQuery .each function

I have a bunch of images on my ASP.NET page like so: for (int i = 0; i < 3; i++) { Image image = new Image(); image.ID = "UpdateStatus"; image.CssClass = "imageCss"; image.ImageUrl = "Bump.GIF"; this.Controls.Add(image); } I want to loop through each image. Why does this not work? i.e. "Function 1" is outputted bu...

Is the foreach in VB.NET faster than in c#?

My co-worker said that in a previous interview, he learned that foreach is faster in VB.Net than c#'s foreach. He was told that this was because both have different CLR implementation. Coming from a C++ perspective, I'm curious on why this is and I was told that I need to read up on CLR first. Googling foreach and CLR doesn't help me un...

System.InvalidOperationException: Transaction does not match connection. linq to sql

Any one ever seen this? It comes from a .net remoting endpoint hosted in IIS with a 16 process web garden. So there are many concurrent transactions in each thread pool per process. We are using linq to sql and the Transaction object that is from the DataContext, NOT the transactionScope object. It seems to happen either around the dispo...

is placing Entity in the name of a Domain Class a good practice?

currently i am discussing if placing entity at the end of each entity is a good practice for example public class CustomerEntity:BaseEntity{} instead of public class Customer:BaseEntity{} in my career i had seen both, but how do you do it nowadays? ...

Learn C# or Java for Web Development

I'm not sure if this is the best way to ask this question but I'm in the very early stages of learning programming/development and there are a lot of things that I would like to do including web development and at some point when I have some proficiency, mobile development. I started out thinking I would learn Java because of its over...

Is there a COM or .Net SDK for Rational Rose?

Is there a COM or .Net SDK for IBM Rational Rose? I need to access information stored in Rational Rose (that the unisys XMI Export add-in does not expose) - I have tried searching a few times but just kept finding references to the java SDK rather then an SDK for rational rose itself... does anyone know if such a thing exists? Ideally ...

Check for garbage collection in .NET?

Is there a way of checking if an object was collected by the Garbage Collector in .NET? I'm trying to write an API that'll hook onto some events of objects that are passed in, and I need to make sure I don't use strong references to the object. I know how to do this, but I'd also like to write a unit test to verify this, and that I don'...