.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

The XML Files: XSLT Processing, Processing Instructions in XML, Parameterizing Statements in XML, an

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

More Related Resource Links

When processing files recursively, why the top DirectoryInfo always throw a Exception?



I have quite a simple app, which modify the CreationTime property of all the subfiles and subfolders in a folder, the code is like:

    void Mod(DirectoryInfo dir, DateTime time)
      foreach (DirectoryInfo subDir in dir.GetDirectories())
        Mod(subDir, time);
      foreach (FileInfo fi in dir.GetFiles())
        fi.CreationTime = time;
      dir.CreationTime = time;

I call this method with a folder like: C:\a\b, then all the subfiles and subfolders are correctly modified, but WHY I received an Exception: The process cannot access the file 'C:\a\b' because it is being used by another process.

I changed the folder to: C:\a, then C:\a\b was modified successfully, then I got an Exception:The process cannot access the file 'C:\a' because it is being used by another process.

thanks in advance.

lengthy processing (getting data in to 3 different temp files)



I need to do lengthy processing (getting data in to 3 different temp files) for final report.

I have SQL script ready and it works on SQL Studio however, same query from ASP get timeout error.

I am looking for some ideas on how to handle and make this work. Where can I place this processing?



Text node containing processing instructions and comments is broken by SQL Server?


Hello, I'm adding xml documents to a typed xml column in SQL Server 10.0.1600. In the document I have text nodes with processing instructions and comments. For some reason these are moved from the middle of the text (between to CDATA nodes) to in front of them; in other words this:

<a:e>Some <?antin oma pi?> text<!-- antin kommentti --></a:e>

becomes this:

  <?antin oma pi?>
  <!-- antin kommentti -->Some  text</a:e>

What am I doing wrong?! A configuration issue? A limitation in the SQL Server? A bug? A known bug? Is there a workaround?


PS. The behaviour can be repeated with this minimalistic test case:


USE SampleDB

N'<?xml version="1.0" encoding="UTF-16"?>
<xs:schema targetNamespace="http://www.index.fi/a"
   xmlns:xs="http://www.w3.org/2001/XMLSchema" >
    <xs:element name="e" type="OtsikkoTyyppi"/>
    <xs:complexType name="OtsikkoTyyppi">

how to impose javascript event processing?


If I have some form control like textbox and I want the event handler to be located in the html instead of at the server side, how to do that? Of course I can copy paste javascript code in the aspx file. But is it possible to do that using some object oriented approach (ie programmatically in the code behind)?


Image processing, determine white space and crop



I have created a image upload for our ID card system to allow users to upload new images, edit them and submit for approval.  This is all working well with a combination of asp.net (c#) and jquery to give a seemless editor etc.

We have had a few users who I cannot believe have scanned a photo of themself and then just submitted it with the A4 page of white and little photo.

I am wondering if anyone can help with a suggestion on how I could possibly reduce the load of these coming through (I can't believe they can be this stupid), it stipulates UK passport standards.

Would my only option be to check for a single continues colour that occurs and if it reaches a certain percentage point say 60% then to just send back an error stating they need to crop the image.

Can anyone help with providing sample or that I can use to move this one on.

I am still in disbelief on this one.  the other one is they take a photo of whole body and other in it and cut straight down middle chopping the people out but supplying a photo that no use for an id photo card....but that I can't imagine being solved programatically as I need to determine where their face dimensions are and what percentage of the actual photo is taken up by it and if it below a threshold reject it.

Easy image processing(grayscale, sepia, negative, resize, brightness, contrast and opacity)

Howdie y'all,

I see a lot of questions in this forum about resizing images. Recently I created a code sample(with downloadable webapp), right here.

The class (downloaded or created) allows for very fast and easy processing of your images. And a lot of problems over here can be solved by simply using that class. I thought it might help to mention the code sample in this forum as well.



Peer Fun: A Peer-To-Peer Work Processing App With WCF


We demonstrate creating a peer-to-peer processing platform where multiple players function together for a common purpose: getting your work done.

Matt Neely

MSDN Magazine June 2009

CLR Inside Out: Unhandled Exception Processing In The CLR


In this installment of CLR Inside Out Gaurav Khanna explains everything you need to know about unhandled exception processing in the .NET Framework.

Gaurav Khanna

MSDN Magazine September 2008

.NET Matters: Asynchronous Stream Processing


This month Stephen Toub discusses asynchronous stream processing.

Stephen Toub

MSDN Magazine March 2008

BizTalk Adapters: Integrate E-Mail Processing Into Your Business Solutions


Use BizTalk Server to monitor e-mail for new messages, trigger confirmations, and persist e-mail and attachments to a custom database.

Alex Starykh

MSDN Magazine December 2006

The XML Files: XSLT Keys, Select vs. Match, Conflict Resolution, and More


This month Aaron Skonnard covers how keys work in XSLT, XSLT match and select attributes, SelectNodes order, finding