Tuesday, April 5, 2011

Login to windows xp programatically

Anyone heard that its possible to login to windows xp programatically, I want to modify the way the Domain Controller authenticates the user and if the user authenticated in my special way it returns the user name and password to the service working on the client machine so it should login the user using its passed credentials from the DC without waiting for user to insert his original credentials.

From stackoverflow
  • Have a look at this: Gina.dll MSDN

    Gina is the system that fingerprint readers etc. use to customise the login screen. You may be able to use this to achieve your purpose?

    To future proof your app (Vista and Windows 7) you may wish to look into these: MSDN Mag Vista Credential Providers

    Spence : Cheers, I had always wondered how the hell windows allowed a fingerprint to substitute for a 3 finger salute so I looked it up one day... ;)
    netseng : Thanks Man, I exactly want to login using fingerprint.

Returning Rows from a .NET Web Service

I am using a .NET web service as an interface to a database. What is the best way to return rows from this web service?

I vaguely remember that .NET 2.0 had issues with returning DataTable objects. Do those issues still exist?

Update: Some of the issues in .NET 1.1. Also, I believe that in 2.0 the DataTable is deserialized as a DataSet object on the client side. Am I correct?

From stackoverflow
  • You're effectively trying to do the job of ADO.net? You much better off returning POCO (plain old c# objects) which you can serialize efficiently to send down soap then pull them back out at the other side. Perhaps you could give us some more information in your question as to what your trying to do.

    DataRows and DataTables haven't changed in .net 3.0. If you want to use the entity framework to pass things around though you will run into different trouble. If they are rows, have a look at using Linq, and serializing then passing row entities as a collection. There are ways to reconstruct the entities into a data context on the client side so that the references link back up etc.

    Vulcan Eager : My web service fetches records from a database. I merely want to return the rows to the client. Returning a DataSet/DataTable should work but I've heard bad things about them back in .NET 2.0. Do any similar issues exist in .NET 3.0?
    Gerrie Schenck : What are those "bad things" actually? Performance?
    Vulcan Eager : No. Here are some links I found: http://support.microsoft.com/kb/306134 and http://bytes.com/groups/net-web-services/376326-possible-return-datatable-webservice-method These apply to .NET 2.0. How are in 3.0?
    Gerrie Schenck : That KB article applies to .Net 1.0 and 1.1. I use datatables with webservices a lot, and never had any problems.
  • I would agree with Spence. With a web service you create a contract with the client. This contract should not be broken just because you want to change the shape of your database. I would create a class that matches the table structure and return a "list of" objects of this structure. Then, when the datamodel changes you can maintain this interface and create a second service method that matches the new structure.

What does the EXE do in the Visual Studio setup project output

We are working on a winforms app in Visual Studio 2005 and the setup project we created output both an MSI and an EXE. We aren't sure what the EXE file is used for because we are able to install without the EXE.

From stackoverflow
  • It's a bootstrapper that checks to make sure that the .NET Framework is installed, before launching the MSI. It's pretty handy.

    I suggest using something like SFX Compiler to package the two together into one self-extracting .exe and then launch the extracted setup.exe. This way you retain the benefits of the bootstrapper, but your users only download a single thing.

    Edit: also see

    Ruben Bartelink : link is broken, any replacement available (simple google didnt yield anythign, but then I didnt know what to look for :P)
    Ruben Bartelink : Anyone know of an SFX compiler that'll work without a GUI?
    Ruben Bartelink : can you also point out that the setup.exe automates the download and install of the prereqs
    loraderon : I'm using Make SFX http://74.cz/en/makesfx/ instead since it supports command line (for automatic builds)
  • I think the EXE is just a wrapper/bootstrapper for the MSI in case you don't have Window Installer. If you have the requisite Windows Installer version installed then the MSI should work fine on its own.

    Ruben Bartelink : it also does auto download of WI and other packages like .NET
  • The EXE checks if Windows Installer 3.0 is present and downloads and installs it if it's not. It's needed only for Windows 2000 or older. Windows XP and newer all have Windows Installer 3.0 out of the box.

    Other prerequisites, like .NET, are checked for by the MSI itself.

    Marek : not true, the bootstrapper checks for all specified prerequisites, including .NET

jQuery - Edit a table row inline

Hi,

I have a table with arbitrary columns and rows. This fact is irrelevant though really, all I want to do is develop a function that will turn a row (or multiple rows) into a series of text inputs containing the data in the table (or empty if no data in cell).

I can't find any examples of people explicitly doing this, so I wondered what people here think is the best way to find a solution.

Thanks :)

From stackoverflow
  • Iterate over the table cells in the rows, and replace the contents with text inputs:

    function editRow(row) {
        $('td',row).each(function() {
             $(this).html('<input type="text" value="' + $(this).html() + '" />');
        });
    }
    

    You need to pass the relevant row/rows into the function obviously.

    Héctor Vergara R. : What happens if cell content has html entities?
    Eran Galperin : I answered it in the simplistic way you described it. I usually use a hidden input with the data in raw form, and load up the text input with that.

How do I automate unit tests for a console application in TeamCity?

I've written a console application that has a number of unit tests and I'm wanting to include it in my nant build script so that it will be run on our TeamCity CIS.

Unfortunately I'm not quite sure how to do that. The nant script has examples of current projects that have been added...they they all have to supply the assemblies that need to be tested. ie MyProject.dll But my console app doesn't have anything like that since it compiles into MyProject.exe

There must be a way to automate these tests since I'm able to run the unit tests from within Visual Studio without issue.

Does anyone know if and how this is possible?

From stackoverflow
  • What Test framework do you use for those tests? You've mentioned Visual Studio, I may guess it is mstest. TeamCity added support for MSTest starting from 4.0 for sln2008 build runner.

    Could you please have a look to a full list of supported .NET unit test frameworks at http://www.jetbrains.net/confluence/display/TCD4/.NET+Testing+Frameworks+Support

    Any way, have a look to custom unit tests integration manual pages at http://www.jetbrains.net/confluence/display/TCD4/Build+Script+Interaction+with+TeamCity

    mezoid : Well technically this question has been answered by Gishu (http://stackoverflow.com/users/1695/gishu) in the first comment to the question. I'm just waiting for him to write his comment up as an answer before I accept someone's answer...
  • I've just noticed xUnit tag. xUnit supports TeamCity. Please refer to http://www.codeplex.com/xunit/WorkItem/View.aspx?WorkItemId=4278 for more details.

    mezoid : I must admit I've only heard about xUnit.net recently. Typically I use the tag xUnit to mean one of the members of a family of unit testing frameworks ie MBUnit, JUnit, NUnit etc...I guess that'll have to change now... but to what? *Unit? LOL
  • The answer to this question is that you add the name of the executable in the same place you add the list of DLL assemblies. The set of unit tests is compiled into the executable instead of into a separate dll file.

    Gishu is the one who should take credit for this answer...since he answered me via a comment...however, I'm wanting to mark this question as answered so I'm writing up the answer so others can benefit from the solution.

    Gishu, if you ever come back to this question, please feel free to write up your comment as an answer and I'll change the accepted answer to yours.

    Gishu : The answer is here... that's all that matters. Your intent is appreciated. Thanks.
    mezoid : No worries! :) Thanks for helping me out on this problem!

Did you get any good out of collaborative editors usage?

Hello, today I was looking for a free collaborative code editor for Mac OS X, I don't really need it but I find the idea pretty charming. So I want to know you opinion about that: is there someone in real world who is using a collaborative code editor and gets some benefits out of it?

From stackoverflow
  • We use it over the Internet when discussing code via Chat/VoIP. Something along:

    A: "If we change this to be an Integer the function gets much simpler" (Edit)

    B: "Niftiy, but then we have to change it here, too" (Edit)

    A: ...

  • If you're pairs programming it is very useful. The approach can be discussed and everyone can drive when they have ideas. I can't say I've had the privilege of using this at work.

    mdorseif : I would say if you are using two computers for pair-programming you aren't pair-programming.
  • I've found it fairly useful when putting together packing/todo/etc lists with my wife while at work. We use google docs, which isn't quite realtime, but it is definitely better than emailing back and forth throughout the day.

  • Anyone else who used collaborative text editors like SubEthaEdit or Gobby?

delphi 7 SOAP application stop compiling

Hello there,

I don't know why, but a SOAP Server application and a pair of clients of this services stop compiling without any know causes for me. I have installed delphi 2007 and delphi 2009 and I don't know if the cause can come from this.

Now when I compile a soap application I get an error like: 'Unit XMLSchema was compiled with a different version of XMLDOM.SHttp'

Someone known the cause?

From stackoverflow
  • Remove all the dcus and try a build all. In case your compile with both d2007 and D2009, be sure to have different folders for the compiled code...
    Make sure also that you don't have a "mixmatch" of D2007 and d2009 path to reference the used units.

  • I think this will not be suficient because this error is raised with new projects too.

    Lars Truijens : You are mixing the same unit of different Delphi versions. Francois is right. Find out why you are mixing them. And please do not use multiple accounts. And please use comments for these type of...well..comments
    Argalatyr : @Lars: he needs 50 rep to leave a comment (of course, it will be hard for him to get there with multiple accounts!)
    Argalatyr : @FrancisR: I know you can't leave a comment, but answers should strictly be used to answer the question. In this case, it would be better to Edit your original question (starting the new text with "EDIT:") and address an answerer, e.g. "@Francois: I think this will not..."
    Lars Truijens : @Argalatyr: You can always comment your own posts according to http://stackoverflow.com/questions/132017/how-do-comments-work-in-stackoverflow of course that won't work if you use multiple accounts
  • At end I found where was the problem. This come from a free library from codebot.org which contains another version of xmldom.pas

    Thank you and regards

    P.D. I will try to refund my accounts.