Monday, October 15, 2007
Some good links October 15
Hierarchical Exception Handling with Enterprise Library
Progress indicators vs. Progress cursor
.Net and Deep Copy
Web Services Best Practices
HttpModule and HttpHandler sections in IIS 7 web.config files
ASP.NET
xacc.propertygrid
Cell Merging of DataGrid in ASP.NET
Management
The myth of the part time Scrum Master
Using Scrum on a multi project development team
Other
BizTalk Services: An overview
Bringing Agility to Architecture, and Architecture to Agility
Wednesday, October 10, 2007
Blog's view changed!!! :(
Unfortunately I have to change the face of the blog. The reason for this action that the current view does not fit well when a code snippet is post - like in my last post. I do not like tthe current design very much but this is the only one template that fits my needs. I'll try soon to edit the template and make it with a little bit better design.
Tuesday, October 9, 2007
Using exsiting IE cookies with HttpRequest
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
The request passes correct and getting the response was working well also. However the content of the response was not the correct one - I mean that it was different than the one I can see if I open an explorer.
What was the difference? The difference was the cookies! When I open the Internet Explorer and navigate to EE the EE server accepts me as logged in user using my cookies. However using the programatically created web request no cookies are associated with the request and the server does not show me the information I want.
During some research and some test I've come across the InternetGetCookie function. This function allows you to get the cookies stored by the Internet Explorer and assign them to your web request.
Here is the code I've come to:
public class RequesstWithCookie
{[DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern bool InternetGetCookie(string lpszUrlName, string lpszCookieName,
[Out] StringBuilder lpszCookieData, [MarshalAs(UnmanagedType.U4)] out int lpdwSize);
CookieContainer cookies;
public RequesstWithCookie(String siteUrl)
{
LoadCookies(siteUrl);
}
public HttpWebRequest CreateRequest(string pageUrl){
Uri uri = new Uri(pageUrl);
HttpWebRequest request = null;
request = (HttpWebRequest)WebRequest.Create(uri);
request.CookieContainer = cookies;return request;
}
private void LoadCookies(String url)
{cookies = new CookieContainer();
Uri uri = new Uri(url);
StringBuilder cookieBuilder = new StringBuilder(new string(' ', 256), 256);int cookieSize = cookieBuilder.Length;
if (!InternetGetCookie(url, null, cookieBuilder, out datasize)){
if (datasize <> 0)
{
return;
}
cookieBuilder = new StringBuilder(datasize);
InternetGetCookie(url, null, cookieBuilder, out datasize);
}
cookies.SetCookies(uri, cookieBuilder.ToString().Replace(";", ","));}
}
Hope this code will help somebody else to not lose an hour or more to find this out.
Thursday, October 4, 2007
Some good links October 04
NUnit Templates and Snippets for Visual Studio 2005 - Now support C#
Releasing the Source Code for the .NET Framework Libraries
ASP.NET
10 Hot ASP.NET Tips and Tricks - 9/28/2007
The ASP.NET Page Lifecycle – A Basic Approach
ASP.Net : Clean up your use of ViewState
Other
Take control of your interview
Scrum for Team System Tips
10 cool web development related articles in 2007
Wednesday, October 3, 2007
Second edition of DevReach finished
Hope that this event will developed itself in future and will bring to Bulgaria more and more speakers of this rank.
There was a little problem with the rooms - some of the rooms was to small to hold everyone that wish to listen Stephen Forte or Miguel Castro. Hope that next year this part of the event will be better.
Thursday, September 27, 2007
Some good links September 27
A good reason for calling GC.Collect()
Being more productive with C# 3.0
Using C# 3.0 Anonymous Types as Dictionaries
LinqDataSource vs ObjectDataSource vs SqlDataSource
A few C# Time Utilities for Fractional Time Values
Implement Sort and Custom Enumerator in Generic List
Reading (Active) Directory information from outside the domain
ASP.NET
How to makeuse of IsPostPack Method inside UserControl?
Calendar UI Extender Control
Tools
15+ Free Visual Studio Add-Ins
Build financial, engineering and scientific applications faster
Other
Why Your Project Plan Will Fail
September 23rd Links: VS, ASP.NET, ASP.NET AJAX, Silverlight, WPF
XUnit.NET aims to be the Next NUnit, but it's too soon
Understanding Agile Software Development
Project Risk Management 101 articles in order
Monday, September 24, 2007
Some good links September 24
Reflection, GetMember() and COM Objects?
Using DocxToText to Extract Text from DOCX Files
Events, Reflection and how they don’t work in C#
How To Use .NET 3.5 "Extension Methods" for Validation
Improving Performance With LINQ
Refactoring Support for XML Literals
The C# ?? null coalescing operator (and using it with LINQ)
Assembly Manipulation and C#/VB.NET Code Injection
Remoting in .NET Using C#
How to go from Thread to ProcessThread
ASP.NET
How do I freeze an ASP.NET GridView header?
LinqDataSouce - DataItem in code behind
Integrate Windows Live ID Authentication Into Your Website
Understanding ASP.NET Web Parts
Rendering ASP.NET Controls out of place
Website screenshot capture with ASP.NET and PHP
Using a Modal Popup to Modify LINQ GridViews
Asynchronous Asp.net Page
Managing Multiple Configuration File Environments with Pre-Build Events
Enum Addin and the new Addins Section
LiveValidation
A Web Spider Library in C#
MSBuild Vs. NAnt
DisplayFusion to manage multiple screens
Other
Get up to speed on Visual Studio 2008
Targetting the .NET Framework 2.0 with Visual Studio 2008
Factonomy
Learning Resources
Process Analysis 101 - Part 1
Good Practice - ETVX
Specifying Good Requirements
Multi-threaded Debugging in Visual Studio 2008
Comparing Flash and WPF
Monday, September 17, 2007
Some good links September 17
[.NET C#] Unified C# 3.0 Specification
Debugging Tip for VS 2008
Debugging and Profiling Features in VS 2008
String Concatenation vs Memory Allocation
ASP.NET
Using DayPilot 2 (Outlook-like calendar/scheduling control for ASP.NET)
ASP .Net Interview Question Answers - 1
Forms Authentication Without Password In ASP.NET
September 16th Links: ASP.NET, ASP.NET AJAX, IIS7, Visual Studio, Silverlight
Other
Learn Lisp today and other stuff
10 Qualities of Good Developer
How Often You Should Run Team Meetings
Top ten tips for software prototyping
[Fill-In-The-Blank] Enterprise Architecture
Scrum Product and Sprint Backlogs using Excel
No One Is Unmistakable
Thursday, September 13, 2007
DevReach event,Sofia, Bulgaria; 1-2 October, 2007
There is a discount if you register before 18th of September, so hury.
Wednesday, September 12, 2007
Experts exchange solutions
.NET
text box label backcolor change on the fly
CLR Integration: Visual Studio 2003, SQL Server 2005
How can I make the child Form's ToolStrip merge with it's parents? (.NET C++/CLI)
How can I tell if the .Net Framework has been installed on a network
Using vb.net, how to send POST request with post data and save the binary response to a file?
Difference between standard and pro version of visual studio
Dynamic Parameter List
License a dll
Unable to Run Exe from Another PC
WebDav & Exchange: Create appointment, avoid overwrite existing one
C#
License a dll
How do I capture the information of the Toolstripmenuitem that was clicked
Unable to Run Exe from Another PC
Menustrip window forms - how do I find the hierarchy of menu items that lead to the menu item clicked and close the dropdownitems
aggregattion in datagridview 2.0
WebDav & Exchange: Create appointment, avoid overwrite existing one
Error loading image
VB.NET
Using vb.net, how to send POST request with post data and save the binary response to a file?
How can I get a list of groups in Active Directory and find out who is in those groups
How to communicate with a device (printer or something else) using an ethernet card
Obtaining Host IP Address
Row Already belongs to this table
Function () with multiple Return values
'Send' is ambiguous across the inherited interfaces 'Outlook._MailItem' and 'Outlook.ItemEvents_10_Event'.
Error Handling in MS Word, Merged rows count issue
Dynamic Parameter List
ASP.NET
text box label backcolor change on the fly
How can I tell if the .Net Framework has been installed on a network
Understanding "Public Shared" Declaration
Monday, September 10, 2007
Some good links September 10
MbUnit 2.4.1 Released
C# 3.0 Features: Object Initializers
ASP.NET
ASP.NET enhancements in VS2008 and .NET FX3.5
Extend Model View Presenter to ASP.Net 2.0
Save Changes on Close of Browser or when exiting the page
Introducing to ASP.NET Page Modules
Cookies and Unicode characters
20 Tips to Improve ASP.net Application Performance
Tools
Paint.NET (download and source code ;) )
Reverse Engineering with Reflector and Reflexil
Ways to use .Net Reflector #2.1: Creating your own add-ins
Using Html Help Builder in Visual Studio 2008
Other
[Fill-In-The-Blank] Enterprise Architecture
How to Configure Client Certificates
Funding Enterprise Architecture Efforts and Why It Matters
New Release: patterns & practices Performance Testing Guidance for Web Applications
Tuesday, September 4, 2007
A trip to an ancient world
Just one week that allows me to see some of the greates things of the world - monumentals, churches and wonderful night life.
It was a pleasure to see another world that was the most powerfull empire in the past. Everything in Rome is fulfilled with energy, glory of the past and smile of the present.
This is a town where you can spent a life and a half to see, understand and become a part of it - not more or less. A life and a half. You can see a monumental or a church right after each corner, you can feel the power of the Catholic Church (even you are not a Catholic).
However I felt the calmness only in those small churches that you can not see on the map. The cursches on those small streets that are not named on the map.
When you see the gloriest Basilica St. Pietro, the Vatican's Museums you will understand why you must another life and half devoted to Rome.
Thursday, August 23, 2007
Some good links August 23
C# 3.0 and LINQ
Creating a managed service factory
PLINQO - Supercharge LINQ to SQL
Mixing .NET remoting with COM+ to set user limitations
Visualizing project dependencies automatically
Typed vs Untyped Datasets - Code Generation
PowerShell: Using PowerShell to Debug .NET Class Libraries
TFS Event Handler in .NET 3.5 Part 1 - The Architecture
ASP.NET
Strong Name Validation failed when Debugging ASP.NET on IIS7
NHibernate Tutorial (1) - and ASP.NET
13 disasters for production web sites and their solutions
Public Hotfix Patch Available for VS 2005 F5 Debugging Performance Issue with ASP.NET
Creating an ASP.NET 2.0 Polling User Control: Design Decisions and the Data Model
Displaying Gentle Error Messages with ASP.NET
Securing Web.config
Encrypt a querystring with expiration
ASP.NET AJAX: Canceling an async postback
Tools
SQL Server Migration Assistant for Oracle V3.1
SketchPath - The XPath Tool
100% Reflective Class Diagram Creation Tool
Other
COM Connection Points
Extending Chain of Responsibility Design Pattern
Pocket Guide to Pocket ACE
How to use C# typeof in Powershell
Leading by Example
Did you know... How to convert spaces to tabs and tabs to spaces?
Tips to become Happy Software Engineer
VS 2008 (Beta 2) Templates for WCF
Wednesday, August 22, 2007
Experts exchange solutions
.NET
A book on Compiling in .Net
CS0234 and System.DirectoryServices
Visual Basic Net Datatable filter by column
make a hole in a form??
Error connecting the Asp.net to the Dbase IV
get bandwith usage of drives
Creating Day Planner in .Net 2.0
Looking for 2 common things
Difference between enumerators and constants
Modify ClickOnce publish page
Problem downgrading TypeDescriptor.GetProperties from .NET 2.0 to 1.1
Reset Visual studio 2005 system message box questions without re-installing
C#
C# Sliding Menu Control
Bluetooth howto
get bandwith usage of drives
Creating Day Planner in .Net 2.0
Looking for 2 common things
Difference between enumerators and constants
VB.NET
Visual Basic Net Datatable filter by column
make a hole in a form??
Looking for 2 common things
Problem downgrading TypeDescriptor.GetProperties from .NET 2.0 to 1.1
Reset Visual studio 2005 system message box questions without re-installing
ASP.NET
override Login Authentication Function
how to reduce the size of an image in asp.net?
Error connecting the Asp.net to the Dbase IV
Monday, August 20, 2007
Some good links August 20
Boxing/Unboxing In .NET
System Setup for .NET 3.0 and .NET 3.5
NGEN perf boost in red bits
The .NET Show on Silverlight
Callbacks, ConcurrencyMode and Windows Clients
Enterprise Library 3.1
C# static constructors are called on demand, not at startup
Analyzing .NET Patches
Materials on .NET FAQs List
10 Things You Should Know About Microsoft's Silverlight
Extension methods and .NET 2.0
LINQ
Multiple Enumeration of LINQ results
LINQ to SQL in Beta 2
LINQ to SQL (fka DLinq): What's new in Orcas beta2
Inserting new records with the ListView & LinqDataSource
LINQ to SQL (Part 6 - Retrieving Data Using Stored Procedures)
Web
Make your ASP.NET application extendable
ASP.NET Orcas Designer Customization
Master Page Reuse Across Applications
ASP.NET 2.0 FileUpload Server Control
How Do I: Determine Whether an Asynchronous Postback has Occurred?
Storing And Displaying Image From Database
Cool new ASP.NET 3.5 and Silverlight demo application
Strong password checker online
Developing IIS7 modules and handlers with the .NET framework
Make your web application run faster
GridView and Paging Alignment
Workflow + InfoPath Forms, Form is not workflow enabled??
Tools
DatePicker in ASP.NET 2.0 and AJAX Control Toolkit
Nevron .NET Vision Q2 2007 now available - AJAX Support, Gauges and many more
VS 2008 Tools menu
Other
Prepare for growing projects
Reading to Be a Better Developer - The Coding4Fun DevKit
Generic Methods
Smart enumerations
Design Patterns
Fading Forms In and Out
Silverlight Controls
Automatically GAC an assembly after a build and include debug info.
The Daily Grind 1207
Design Patterns
When BizTalk meets SharePoint, it makes sense…
ESB Guidance
What is the order of evaluation in C#?
Why the debugger will not hit your breakpoints?
E -Books Collection( Free Torrent Download)
Microsoft Interview Questions
Running FxCop and the quirks
CopySourceAsHtml in Visual Studio 2008
SOA in the Real World
Microsoft Biztalk Server 2006 Management Pack for Operations Manager 2007
Using managed code to detect what .NET Framework versions and service packs are installed
Building LINQ Queries at Runtime in F#
A couple SharePoint logging tricks (Dev Environment only)
Mixing VS2008 with VS2005
Wednesday, August 15, 2007
Experts exchange solutions
.NET
Dialing/Displaying Phone numbers on a PDA Phone
Build options in VB2005
kill keyboard mouse
is process active from process ID
Marshal array of strings
How to pass a dynamic two-dimensional array from c# to c++
Check if the program is in developing mode
physical html files on fly asp.net vs2005
Restore Application/VB.Net 2005
DataSet, BindingNavigator and DataGridView
Crystal Report Export options
VS2005 : Saving after each change
C#
kill keyboard mouse
is process active from process ID
How to pass a dynamic two-dimensional array from c# to c++
Check if the program is in developing mode
physical html files on fly asp.net vs2005
VB.NET
Encrypting / Decrypting String Data
Timed out. This may have occurred because all pooled connections were in use and max pool size was reached. cmd.Connection.Open()
Restore Application/VB.Net 2005
DataSet, BindingNavigator and DataGridView
ASP.NET
Export part of webpage to Excel
How to Implement Right Click Event
Encrypting / Decrypting String Data
server side redirection
Timed out. This may have occurred because all pooled connections were in use and max pool size was reached. cmd.Connection.Open()
OO ASP.net - trying to understand the principles of using objects with ASP.net
Error when attempting to write out XML file
Monday, August 13, 2007
Some good links August 13
http://dotnetguts.blogspot.com/2007/07/net-framework-35-new-features.html
http://shailkpatel.blogspot.com/2007/06/new-stuff-in-net-framework-35.html
http://msdn.microsoft.com/msdnmag/issues/07/04/CLRInsideOut/#S6
.Net framework version comparison
Adventures in .NET 3.5 Part I, Part II, Part III, Part IV
ASP.NET 3.5 controls
LINQ Changes from Orcas Beta 1 to VS 2008 Beta 2
Speed Test: A No-Code LINQ-Based ASP.NET 3.5 Page
Introduction to Visual Basic 9.0 Features
Changes in the .NET BCL between 2.0 and 3.5
Relaxed Delegates
Web
Welcome to patterns & practices Web Client Guidance Community site
Make your web application run faster
SOAP Header Extensions How-To
The Remaining Nine "Working with Data in ASP.NET 2.0" Tutorials
Hosting ASP.NET for .NET Framework 3.5 Beta 2 in Medium or Partial Trust
ListView and GroupTemplate Example
Using XML Web Services in Traditional ASP
How To: Create an ASP.NET AJAX Toolkit Extender Control to Extend a GridView
The asp:ListView control (Part 1 - Building a Product Listing Page with Clean CSS UI)
IIS/ASP.NET Settings and Virtual Directory Inheritance
LINQ
Querying XML documents with LINQ to XML
LINQ to SQL : Using Transaction
Using LINQ to XML (and how to build a custom RSS Feed Reader with it)
LINQ, Lambda, and Generics
LINQ samples
Tools
NxBRE -The open-source rule engine for the .NET
Diagrams with Reflector and the Graph Plugin (Part 1)
Capture Entire Web Page
JetBrains releases ReSharper 3.0
FlexWiki 2.0 Beta 2 Released
Dynamic Application Configuration Solution
West Wind Html Help Builder Update
Export from Database In Different Formats: PDF, Excel, Access, XML, HTML, FoxPro, CSV
The Code Project Browser Add-in for VS 2005
Microsoft Visual Studio 2008 SDK August 2007 Community Technology Preview
Other
Oracle bulks up .NET tools
Fixing a VS.NET 2008 Beta 2 ASP.NET Debugging Issue on Vista: "Strong name validation failed"
Dynamically invoke a method, given strings with method name and class name
Using the platform for XML (and how to create a custom RSS Feed Reader c)
Unit Testing Multithreaded methods
Introduction to Development Tools for Windows Mobile-based Devices
How to Debug MPI Applications in Visual Studio 2005 (Part 1)
How to Debug MPI Applications in Visual Studio 2005 (Part 2)
Great New ASP.NET 2.0 Data Tutorials Published
Localizing .NET Enums
An Intelligent Data Layer
ASP.NET GridView Image Command Button Problem (multiple PostBacks)
XmlWriter and Schema
Visual Studio 2008 Shell
Final TFS 2008 Feature List
Concurrency in .NET
.NET Rocks! - Introducing Acropolis
Interview
IIS and .NET 2.0 interview questions
Interview questions for .NET
Thursday, August 9, 2007
Wednesday, August 8, 2007
Experts exchange solutions
These are the best solutions provided by the experts in the www.experts-exchange.com for the last week.Remember that if you want to see the solution you must register in the site first.
VB.NET
Autamatically installing a windows service
Simple Question Using WMI in VB 2005 .Net
Operator Overload VB.net Visual Studio 2005
ASP.NET
ASP.NET Postback advice?
HTTP 403 Forbidden after Upgrade Win XP Professional
Updating Profile Information for Authenticated Users
Determine Row Index - Template Control Buttons in Gridview
creating a TemplateField in a GridView dynamically
ASPx web page error - Failed to access IIS metabase
Public Declaration of SQLBulkCopy and csvDataReader
.NET
Enterprise Library for .NET
DateTimePicker validating event unreliable
Installing .NET Framework 2.0 and 3.0 x86 fail using microsoft update
C#: Reflection Method not Found
Other
What is the difference between JavaScript and the Java programming language?What is a cookie? What are the advantages and disadvantages of using cookies in a web application?
state management engine like experts-exchange.com
WYSIWYG Editors
How to create a C++ wrapper DLL to expose functions from a C++ .lib and .h (header) file?
Monday, August 6, 2007
Some good links August 06
Building LINQ Queries at Runtime
User bar code fonts in C#.net
ASP.NET 2.0 Membership, Roles, Forms Authentication, and Security Resources
Install a Windows Service in a smart way instead of using the Windows Installer MSI package
How long before ALT.NET becomes NOT.NET?
Improving Performance of Asp.Net Application
Using Reflection to Test Web Controls - Part I and Part II
Adding Custom Dialog to Visual studio .Net 2003 project
A brief architecture overview of VMware ESX, XEN and MS Viridian
A Developers Toolkit for C# and .Net
Automated testing of ASP.NET web applications using Selenium
ASP.NET 2.0 Features - Ten things you might not know about ASP.NET 2.0
All Roads Lead to Rome (How you can maintain scroll position on postback)
Multi-threading in .NET: Introduction and suggestions
Implementing a generic CSV file importer using reflection and attribute based programming in C#.NET
Sending mails:
http://www.codeproject.com/aspnet/EasySMTP_package.asp http://www.codeproject.com/aspnet/smtpmail.asp http://www.codeproject.com/aspnet/techblaster.asp http://www.codeproject.com/useritems/Send_Emails_in_ASPNET20.asp http://www.codeproject.com/useritems/SendMailSMTPWebConfig.asp http://www.codeproject.com/useritems/Seding_Mail.asp http://aspnet.4guysfromrolla.com/articles/072606-1.aspx http://aspnet.4guysfromrolla.com/articles/080206-1.aspx
SOAP messages exchange between .Net clients and Axis Apache web services
Generic sorting argorithm (QuickSort)
How To: Access Underlying Data of the ObjectDataSource
.NET FRAMEWORK 3.0 is worth learning? by Niraj Yadav
Reading XML document fragments in .NET
Monday, July 30, 2007
Experts exchange solutions
Remember that if you want to see the solution you must register in the site first.
.NET
ASP.NET
- Title : Very Slow Page Loads After Inactivity
- Title : Can I upload files to a server using ASP.NET programming, if so, is ASP.NET the best way to do this?
- Title : UpdatePanel is not a known element
- Title : Criteria selection: drop downs VS. radio buttons
- Title : How Build "One Moment Please" functionality
- Title : Unlocking the record of a table from asp.net 2.0
- Title : How to popup windows like MSN?
- Title : Need a solution for creating a report in vb.net, other then using Crystal Reports
- Title : Request.Form("whatever").Count equivalent in VB.Net ?
- Title : Unlocking the record of a table from asp.net 2.0
- Title : Locating csc.exe from within my C# code (building/compiling classes at RunTime)
Some good links July 30
Moving Projects/Solutions between Orcas and Visual Studio 2005 - http://www.west-wind.com/weblog/posts/122975.aspx
Nothin but .NET - Tips and Tricks - Day 3 - http://weblogs.asp.net/bsimser/archive/2007/07/26/nothin-but-net-tips-and-tricks-day-3.aspx
How to Use Web.Config in ASP.NET and ASP - http://vgbsoft.blogspot.com/2007/07/how-to-use-webconfig-in-aspnet-and-asp.html
A Generic State Machine and Attempt to Generic Component - http://www.codeproject.com/useritems/GenericStateMachine.asp
AWUI - a simple web user interface library with AJAX support - http://www.codeproject.com/Ajax/awui.asp
Using AJAX to populate a drop-down list in ASP.NET - http://www.codeproject.com/Ajax/PopulatingDropDownLists.asp
Email templates - http://www.codeproject.com/useritems/mailtemplates.asp
Sorting collection of custom types generically - http://www.codeproject.com/useritems/sorting_custom_types.asp
Nice VS 2008 Code Editing Improvements - http://weblogs.asp.net/scottgu/archive/2007/07/28/nice-vs-2008-code-editing-improvements.aspx
Dynamic Message Display (ASP.NET) - http://www.codeproject.com/useritems/Dynamic_Message_Display.asp
Diffrence between Oracle and sql server 2000 - http://www.dotnetspider.com/kb/Article3289.aspx
Friday, July 27, 2007
Tuesday, July 24, 2007
Applications & Links
.Net applications
- C# and VB.NET Line Count Utility
- Spec# for Visual Studio 2005
- ToDoList 5.3 Beta Release (A hierarchical task manager with native XML support for custom reporting.)
VS Addin
- Exec inline Addin for Visual Studio 2005
External links lists
- http://spietrek.blogspot.com/2007/07/links-7232007.html
- http://www.hanselman.com/blog/ScottHanselmans2006UltimateDeveloperAndPowerUsersToolListForWindows.aspx
- ASP.NET, ASP.NET AJAX, Visual Studio, Silverlight and IIS7
- ASP.NET, ASP.NET AJAX, Visual Studio and .NET
- ASP.NET, Visual Studio, Silverlight, WPF and .NET
- http://spietrek.blogspot.com/search?q=Links
Monday, July 23, 2007
Interview questions
Today I have read another blog's post of Rodney Vinyard that gives more questions about interview about .Net framework - check it out.
New : Giving and taking an Interview (A brief article on interviewing both as an interviewer and interviewee)
New : IIS and .NET 2.0 interview questions Interview questions for .NET (Update 13/08/2007)
Wednesday, July 18, 2007
.NET Tips & Tricks by Michael Nemtsev
You must read and try to learn it as much as you can.
Monday, July 16, 2007
Count .NET projects lines
However it is very usefull to have information how many lines of code are written in a file or in a project. Also how many lines of comments are included and so on.
This kind of information will not change anything in your project but should you direct you if the things are going well and can quickly answer you some simple questions - Is there any comments in this file/project? What is the total amount of code lines produced from the beginning of the project? What is the correlation between the autogenerated code and your 'true' code.
I've found a very nice utility that counts the number of lines in a C#, VB or C++ .NET solutions or projects related with the above questions.
Check this out.
How I am becoming a better developer, part 1 of infinity
Friday, July 13, 2007
Create an ASP.NET ProgressBar
New (24/7/07): Here is another progress bar using ajax: AJAX file upload
Thursday, June 28, 2007
Thursday, June 14, 2007
Do you know what has .NET Framework in it?
The Most Useful .NET Utility Classes Developers Tend To Reinvent Rather Than Reuse written by Phil Haack. This is a wonderful discussion with samples what is included in the .NET Framework that we should use direct from the System namespaces instead of writting custom methods.
I sugest you to read the comments too. There are some very useful notes.
Wednesday, May 9, 2007
Free refactoring tools for ASP.NET code in Visual Studio 2005
Friday, April 13, 2007
Friday, January 12, 2007
Reflection: Modify value types by reflection
Yes, but no thanks. This could not happend because the structure is value type and not reference type. In this case the code
MyStruct _name = new MyStruct();
_name.familyName = "Smith";
_name.givenName = "John";
foreach (FieldInfo fi in _name.GetType().GetFields())
{
fi.SetValue(_name, "set value test");
}
will not change the content of the structure at all. But this work perfect if you would use class instead of structure. I've decided to check if anybody on the net is trying to do things lilke this and of cource I saw a lot of articles on the net where programmers are talking about using ValueType object to work with strucutre in this situation.
So trying to move forward I have written this:
MyStruct _name = new MyStruct();
_name.familyName = "Smith";
_name.givenName = "John";
ValueType vt = _name;
FieldInfo[] fis = _name.GetType().GetFields();
for (int i = 0; i <>
{
FieldInfo fi = fis[i];
if (_name.GetType().IsValueType)
{
fi.SetValue(vt, "set value test");
fi.SetValue(_name, "Test");
}
}
This code should work like a sharp. In the above code when is using
fi.SetValue(_name, "Test");
the content of the structure will not be changed. But - the vt variable which is ValueType will be changed via the line
fi.SetValue(vt, "set value test");
So I believe this was the right way and the task is finished. I wanted to help the guy to change the values of the structure, I have found that using ValueType class is the right direction to do this and at the end of the code above I have the changed structure's fields.
Opps! I do not have the structure's fields changed! I do have changed the fields of the ValueType variable changed. So because the ValueType class is the base class of all value types, it is normal that you can not cast the variable vt back to the structure MyStructure type.
So at the end of writting this code I had changed the values of the fields but the result that had to return was not of type MyStruct and of type ValueType. What a hell? It is obviously that you could not change the structure's fields by reflection - BECAUSE IT IS A VALUE TYPE!
Ok! But there should be a way! There must be a way of passing to a method strucutre instance and return as a result instance of the same strucutre with changed by Reflection values.
All I had moving around is in some way calling the constructor of the structure by passing parammeters. Using Reflection is it not possible. Why? BECAUSE IT IS A VALUE TYPE!. And the code of using ConstructorInfo.Invoke will produce the same result like the code above - No change to the structure instance. Is there any other way a constructor can be called?
Yes! There is a way! In System namespace there is a class called Activator. And was happy to read the brief description of this class:
"Contains methods to create types of objects locally or remotely, or obtain references to existing remote objects. This class cannot be inherited."
So researching the class' methods I have found that there is a method CreateInstance that return the newly created instance (see that when using reflection and call the ConstructorInfo.Invoke you do not return any instance.The reflection is used the passed object and is trying to create the new instance on the passed variable).
So after reading a while and trying it I have finally written this which works like a charm:
public static MyStruct ChangeValues(MyStruct previousVersion)
{
MyStruct changedVersion = default(MyStruct);
ValueType valueType = previousVersion;
MemberInfo[] members = valueType.GetType().GetMembers();
for (int memberIndex = 0; memberIndex < style="color:#3333ff;">if (members[memberIndex].MemberType == MemberTypes.Field)
{
if (valueType.GetType().GetField(members[memberIndex].Name).FieldType == typeof(String))
{
changedVersion = (MyStruct)Activator.CreateInstance(changedVersion.GetType(), new object[] { "test", 3 });
}
}
}
return changedVersion;
}
public struct MyStruct
{
public String variableString;
public Int32 variableInt32;
public Boolean variableBoolean;
public MyStruct(String var1, Int32 var2)
{
variableString = var1;
variableInt32 = var2;
variableBoolean = false;
}
}
This finally, I think, finish the task of passing parameter of structure to the method and return a changed instance of the same structure using Reflection.
Regards
Tuesday, January 9, 2007
Debugging problems in .NET
Also many time in ExpertsExchange I'm talking with members in exaclty the same problems.
One of the very good document I have founded on the net is "my best friend" in all these situations. And when yestarday I found that is really hard to find this document out i decided to add another link to this document.
It is really cool to read it. Here it is