Search posterous

Search all posts and users. Type a name, type a favorite song title, whatever! See what comes up.
  

More posterous blogs











More recommended blogs »

Here are posterous posts filed under mynotes...

sudheer says...

You may come across the error “The process cannot access the file ‘abc.txt’ because it is being used by another process” while programming in DotNet environment. Usually this case occurs when you create a file and do some operation, before completion of the operation or if the file object is been available in memory and you try to either delete the file or rename or open using Read Write mode you will get this error.

Following are some of the problem case and solution to get through this error.

Problem Case – 1 : Created a file using file stream, and before closing the file stream object trying to delete the file or rename the file

Solution : Close the file stream, flush the file stream object before you do other processing

Best Practice: Open a file stream object in try block and close it in finally block

Problem Case – 2 : When you attach a file to System.Net.Mail.Attachment object and send an email, After the email is sent if you delete the file, You may get the same error

Solution : After the email has been sent, dispose the Attachment object manually, before deleting or renaming the file. You cannot open the file in Read Write Mode also if the file object is not disposed

Best Practice : In order to make sure the email has been sent properly before disposing the file object from memory, sleep for few second before disposing the file object

Problem Case – 3: When you open a file which has been already opened for Read Write Mode to write some content. This case may occur when you open a file in the parent method, and you need to write some content to file in child method also. so when you try to open the file again, You may get the same error.

Solution : Instead of reopening the file again, you can pass the file object as a reference argument to the child method

There are several other occasions where you may face the error “The process cannot access the file ‘abc.txt’ because it is being used by another process”, The main reason is that the object instance is still available in main memory.

Source: Tech notes

Filed under: MyNotes

sudheer says...

Microsoft Silverlight is a cross-browser, cross-platform implementation of the .NET Framework for building and delivering the next generation of media experiences and rich interactive applications (RIA) for the Web. Silverlight unifies the capabilities of the server, the Web, and the desktop, of managed code and dynamic languages, of declarative and traditional programming, and the power of Windows Presentation Foundation (WPF).

What Is Silverlight?

Silverlight enables you to create a state-of-the-art application that has the following features:

·         It is a cross-browser, cross-platform technology. It runs in all popular Web browsers, including Microsoft Internet Explorer, Mozilla Firefox, and Apple Safari, and on Microsoft Windows and Apple Mac OS X.

·         It is supported by a very small download that installs in seconds.

·         It streams video and audio. It scales video quality to everything from mobile devices to desktop browsers to 720p HDTV video modes.

·         It includes compelling graphics that users can manipulate—drag, turn, and zoom—directly in the browser.

·         It reads data and updates the display, but it doesn't interrupt the user by refreshing the whole page.

Web developers and graphics designers can create Silverlight-based applications in a variety of ways. You can use Silverlight markup to create media and graphics, and manipulate them with dynamic languages and managed code. Silverlight also enables you to use professional-quality tools like Visual Studio for coding and Microsoft Expression Blend for layout and graphic design.

What Features Are in Silverlight?

Silverlight combines multiple technologies into a single development platform that enables you to select the right tools and the right programming language for your needs. Silverlight offers the following features:

·         WPF and XAML. Silverlight includes a subset of the Windows Presentation Foundation (WPF) technology, which greatly extends the elements in the browser for creating UI. WPF lets you create immersive graphics, animation, media, and other rich client features, extending browser-based UI beyond what is available with HTML alone. Extensible Application Markup Language (XAML) provides a declarative markup syntax for creating elements.

·         Extensions to JavaScript. Silverlight provides extensions to the universal browser scripting language that provide control over the browser UI, including the ability to work with WPF elements.

·         Cross-browser, cross-platform support. Silverlight runs the same on all popular browsers (and on popular platforms). You can design and develop your application without having to worry about which browser or platform your users have.

·         Integration with existing applications. Silverlight integrates seamlessly with your existing JavaScript and ASP.NET AJAX code to complement functionality you have already created.

·         Access to the .NET Framework programming model and to associated tools. You can create Silverlight-based applications using dynamic languages such as IronPython as well as languages such as C# and Visual Basic. You can use development tools such as Visual Studio to create Silverlight-based applications.

·         Networking support. Silverlight includes support for HTTP over TCP. You can connect to WCF, SOAP, or ASP.NET AJAX services and receive XML, JSON, or RSS data.

·         LINQ. Silverlight includes language-integrated query (LINQ), which enables you to program data access using intuitive native syntax and strongly typed objects in .NET Framework languages.

Filed under: MyNotes