Saturday, September 26, 2009

How can i copy the files in the debug folder to some other directory automatically ?

Add the following line of code to the Post build event in the project properties,
call copy E:\projectdir\bin\Debug c:\test\

What is the name of the file you need to change to add pre- and post-build functionality into your custom package ?

Targets file.
It is located in ,
%WINDOWS%\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets

Tell some of the new features of ASP.NET 3.5?


1. Expression Trees
2. Controls
1. ListView
2. DataPager
3. Support for LINQ, WCF , WPF and WWF

What are the options available on creating a branch?

There are 5 options available on creating a branch, they are :
1. Changeset
2. Date
3. Label
4. Latest Version
5. Workspace version

How will you check whether automated build is successful and call a custom task on successful build?

You can do that by providing the following config entry in the MS Build or TFS Build config file,
BuildUri="$(BuildUri)"
Condition=" '$(IsDesktopBuild)' != 'true' ">






What are the new Features in Team Build 2008 ?

1. Continuous Integration
2. Build Queuing
3. Scheduled Builds
4. Build Agent Management
5. Build Definition Editing GUI
6. Better Build Management
7. Managed object model
8. Improved extensibility

What are the blocks in Enterprise Library?


1. The Caching Application Block

2. The Cryptography Application Block

3. The Data Access Application Block

4. The Exception Handling Application Block

5. The Logging Application Block

6. The Policy Injection Application Block

7. The Security Application Block

8. The Unity Application Block

9. The Validation Application Block

What are the Predefined bindings in WCF?

1. BasicHttpBinding
2. WSHttpBinding
3. WSDualHttpBinding
4. NetTcpBinding
5. NetNamedPipeBinding
6. NetMsmqBinding

What is the expansion of TDD?

Test-Driven-Development .


www.codecollege.NET

What will the deployment retail="true" do when set in a asp.net web.config file?

It forces the 'debug' attribute in the web.config to false, disables page output tracing, and forces the custom error page to be shown to remote users rather than the actual exception.

What is the Svcutil.exe ?

Service Model Metadata Utility Tool is used to generate the proxy from the client.

Explain what is a DTO?

A DTO is a pattern used to transfer data between applications.


www.codecollege.NET

What are the uses of Views?

1. Views are virtual tables (they dont store data physically) which gives a result
of data by joining tables. So you are not storing redundant data.


2. Views are used to produce reports from data


3. Views can be used to provide security to data by giving access only to views.

What’s the difference between authentication and authorization?

what is Authentication?


Is a process by which the system decides whether the user is valid to login to the site as a whole.


what is Authorization?


Is a process by which the system decides which are the areas and functionalities the user is allowed to access, at the component level.

What is Serialization ? What are the Types of Serialization and their differences?

Serialization:
It is the process of converting an object to a form suitable for either making it persistent or tranportable.
Deserialization is the reverse of this and it converts the object from the serialized state to its original state.

Types:
1. Binary
2. XML

Differences:
SnoBinary XML
1

It preserves type fidelity , which is useful for preserving


the state of the object between transportation and invocation.


It doesnt preserves type fidelity and hence state cant be


maintained.

2As it is the open standard its widely usedNot that much compared to
Binary.

What is assemblyInfo.cs file? Where can I find it? What is it for?

What
It consists of all build options for the project,including verison,company name,etc.
Where
It is located in the Properties folder.
Use
It is used to manage the build settings.

What is the name of the class used to read and get details of the files uploaded to asp.net?

System.Web.HttpPostedFile

What is web.config.? How many web.config files can be allowed to use in an application?

1.

The Web.Config file is the configuration file for
asp.net web application or a web site. prefix="o" ?>


2.

You can have as many Web.Config files as you want
, but there can be only one web.config file in a single folder.

What are asynchronous callbacks in .net?

It means that a call is made from a Main Program to a .net Class’s method and the program continues execution. When the callback is made ( means the method has finished its work and returns value) , the Main program handles it.

How to download webpage using asp.net and c# ?

See the following code,

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Net;

namespace DownloadingFile
{
class Program
{
static void Main(string[] args)
{
WebRequest reqFile = WebRequest.Create("http://www.codecollege.net/2009/07/cloud-computing.html");

WebResponse resFile = reqFile.GetResponse();

Stream smFile = resFile.GetResponseStream();
// Output the downloaded stream to the console
StreamReader sr = new StreamReader(smFile);
string line;
while ((line = sr.ReadLine()) != null)
Console.WriteLine(line);
Console.Read();
}
}
}

How to download webpage using asp.net and c# ?

See the following code,

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Net;

namespace DownloadingFile
{
class Program
{
static void Main(string[] args)
{
WebRequest reqFile = WebRequest.Create("http://www.codecollege.net/2009/07/cloud-computing.html");

WebResponse resFile = reqFile.GetResponse();

Stream smFile = resFile.GetResponseStream();
// Output the downloaded stream to the console
StreamReader sr = new StreamReader(smFile);
string line;
while ((line = sr.ReadLine()) != null)
Console.WriteLine(line);
Console.Read();
}
}
}

How to read and write from a text file using c#.net ?

See the following sample,

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace ReadWriteFromTxt
{
class Program
{
static void readFile()
{
FileStream fsEmp = new FileStream("c:\\Emp.html", FileMode.Open, FileAccess.Read);
StreamReader srEmp = new StreamReader(fsEmp);
string s;
while ((s = srEmp.ReadLine()) != null)
{
Console.WriteLine(s);
Console.Read();
}
srEmp.Close();
fsEmp.Close();
}

static void writeFile()
{
FileStream fsEmp = new FileStream("c:\\Emp.html", FileMode.Open, FileAccess.Write );
StreamWriter swEmp = new StreamWriter(fsEmp );

string s="Have you seen god? Is there anything else to see";
swEmp.WriteLine(s);
swEmp.Close();
fsEmp.Close();

}


static void Main(string[] args)
{
writeFile();
readFile();
}
}
}

what are the Differences between Abstract Class and Interface ?

SnoAbstract
Class
Interface
1 Can have implemented Methods Cant
2 A class can inherit only one abstract class A Class can implement any number of Interfaces.
3 We go for Abstract classes on such situations
where we need to give common functionality for group of related classes
We go for Interface on such situations where we
need to give common functionality for group of un-related classes
4 If you add a new method, then you can provide a
default implementation and so no need to make any change to existing work.
If you add a new method, then you need to change
all the existing work.
5
Static and Instance constants are possible.
Only
Static constants are possible.

How can you tell the application to look for assemblies at the locations other than its installed location?

You can do that by adding the following entry in the web.config file,


How to read and write from a text file using c#.net ?

See the following sample,

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace ReadWriteFromTxt
{
class Program
{
static void readFile()
{
FileStream fsEmp = new FileStream("c:\\Emp.html", FileMode.Open, FileAccess.Read);
StreamReader srEmp = new StreamReader(fsEmp);
string s;
while ((s = srEmp.ReadLine()) != null)
{
Console.WriteLine(s);
Console.Read();
}
srEmp.Close();
fsEmp.Close();
}

static void writeFile()
{
FileStream fsEmp = new FileStream("c:\\Emp.html", FileMode.Open, FileAccess.Write );
StreamWriter swEmp = new StreamWriter(fsEmp );

string s="Have you seen god? Is there anything else to see";
swEmp.WriteLine(s);
swEmp.Close();
fsEmp.Close();

}


static void Main(string[] args)
{
writeFile();
readFile();
}
}
}

DISCLAIMER

WE USE LINKS TO SITES AND NOT DIRECT DOWNLOAD LINKS. THERE NO FILES HOSTED ON OUR SERVER,THEY ARE ONLY INDEXED MUCH LIKE GOOGLEWORKS.
The hosting server or the administrator cannot be held responsible for the contents of any linked sites or any link contained in a linked site, or changes / updates to such sites.

BY ENTERING THIS SITE YOU AGREE TO BE BOUND BY THESE CONDITIONS
If you don't like the software posted here, please don't hesitate to let us know and we will unpost it.