- Write a simple Windows Forms MessageBox statement.
System.Windows.Forms.MessageBox.Show
("Hello, Windows Forms");
- Can you write a class without specifying namespace? Which namespace does it belong to by default??
Yes, you can, then the class belongs to global namespace which has no name. For commercial products, naturally, you wouldn’t want global namespace.
- You are designing a GUI application with a window and several widgets on it. The user then resizes the app window and sees a lot of grey space, while the widgets stay in place. What’s the problem?
One should use anchoring for correct resizing. Otherwise the default property of a widget on a form is top-left, so it stays at the same location when resized.
- How can you save the desired properties of Windows Forms application?
.config files in .NET are supported through the API to allow storing and retrieving information. They are nothing more than simple XML files, sort of like what .ini files were before for Win32 apps.
- So how do you retrieve the customized properties of a .NET application from XML .config file?
Initialize an instance of AppSettingsReader class. Call the GetValue method of AppSettingsReader class, passing in the name of the property and the type expected. Assign the result to the appropriate variable.
- Can you automate this process?
In Visual Studio yes, use Dynamic Properties for automatic .config creation, storage and retrieval.
- My progress bar freezes up and dialog window shows blank, when an intensive background process takes over.
Yes, you should’ve multi-threaded your GUI, with taskbar and main form being one thread, and the background process being the other.
- What’s the safest way to deploy a Windows Forms app?
Web deployment: the user always downloads the latest version of the code; the program runs within security sandbox, properly written app will not require additional security privileges.
- Why is it not a good idea to insert code into InitializeComponent method when working with Visual Studio?
The designer will likely throw it away; most of the code inside InitializeComponent is auto-generated.
- What’s the difference between WindowsDefaultLocation and WindowsDefaultBounds? WindowsDefaultLocation tells the form to start up at a location selected by OS, but with internally specified size. WindowsDefaultBounds delegates both size and starting position choices to the OS.
- What’s the difference between Move and LocationChanged? Resize and SizeChanged?
Both methods do the same, Move and Resize are the names adopted from VB to ease migration to C#.
- How would you create a non-rectangular window, let’s say an ellipse?
Create a rectangular form, set the TransparencyKey property to the same value as BackColor, which will effectively make the background of the form transparent. Then set the FormBorderStyle to FormBorderStyle.None, which will remove the contour and contents of the form.
- How do you create a separator in the Menu Designer?
A hyphen ‘-’ would do it. Also, an ampersand ‘&\’ would underline the next letter.
- How’s anchoring different from docking?
Anchoring treats the component as having the absolute size and adjusts its location relative to the parent form. Docking treats the component location as absolute and disregards the component size. So if a status bar must always be at the bottom no matter what, use docking. If a button should be on the top right, but change its position with the form being resized, use anchoring.
Simple Questions:
- What is a static class?
- What is static member?
- What is static function?
- What is static constructor?
- How can we inherit a static variable?
- How can we inherit a static member?
- Can we use a static function with a non-static variable?
- How can we access static variable?
- Why main function is static?
- How will you load dynamic assembly? How will create assesblies at run time?
- What is Reflection?
- If I have more than one version of one assemblies, then how will I use old version (how/where to specify version number?) in my application?
- How do you create threading in.NET? What is the namespace for that?
- What do you mean by Serialize and MarshalByRef?
- What is the difference between Array and LinkedList?
- What is Asynchronous call and how it can be implemented using delegates?
- How to create events for a control? What is custom events? How to create it?
- If you want to write your own dot net language, what steps you will you take care?
- Describe the diffeerence between inline and code behind - which is best in a loosely coupled solution?
- How dot net compiled code will become platform independent?
- Without modifying source code if we compile again, will it be generated MSIL again?
- How does you handle this COM components developed in other programming languages in.NET?
- How CCW (Com Callable Wrapper) and RCW (Runtime Callable Wrappers) works?
- What are the new thee features of COM+ services, which are not there in COM (MTS)?
- What are the differences between COM architecture and.NET architecture?
- Can we copy a COM dll to GAC folder?
- What is Shared and Repeatable Inheritance?
- Can you explain what inheritance is and an example of when you might use it?
- How can you write a class to restrict that only one object of this class can be created (Singleton class)?
- What are virtual destructures?
- What is close method? How its different from Finalize and Dispose?
- What is Boxing and UnBoxing?
- What is check/uncheck?
- What is the use of base keyword? Tell me a practical example for base keyword’s usage?
- What are the different.NET tools which you used in projects?
- What will do to avoid prior case?
- What happens when you try to update data in a dataset in.NET while the record is already deleted in SQL Server as backend?
- What is concurrency? How will you avoid concurrency when dealing with dataset?
- One user deleted one row after that another user through his dataset was trying to update same row. What will happen? How will you avoid this problem?
- How do you merge two datasets into the third dataset in a simple manner?
- If you are executing these statements in commandObject. “Select * from Table1; Select * from Table2″ How you will deal result set?
- How do you sort a dataset.
- If a dataset contains 100 rows, how to fetch rows between 5 and 15 only?
- What is the use of Parameter object?
- How to generateXML from a dataset and vice versa?
- How do you implement locking concept for dataset?
- How will you do Redo and Undo in TextBox control?
- How to implement DataGrid in.NET? How would you make a combo-box appear in one column of a DataGrid? What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for DataGrid methods. what is the access specifier used for that methods in the code behind file and why?
- How can we create Tree control in asp.NET?
- Write a program in C# to find the angle between the hours and minutes in a clock?
- Write a program to create a user control with name and surname as data members and login as method and also the code to call it.
- How can you read 3rd line from a text file?
- Explain the code behind wors and contrast that using the inline style.
- Explain different types of HTML, Web and server controls.
- What are the differences between user control and server control?
- How server form post-back works?
- Can the action attribute of a server-side
- How would ASP and ASP.NET apps run at the same time on the same server?
- What are good ADO.NET object to replace to ADO Recordset object.
- Explain the differences between Server-side code and Client-side code.
- What type of code(server or client) is found in a Code-Behind class?
- Should validation (did the user enter a real date) occur server-side or client-side? Why?
- What does the “EnableViewState” property do? Why would I want it on or off?
- What is the difference between Server.Transfer and response.Redirect? Why?
- Can you give an example of when it would be appropriate to use a web service as opposed to a non-serviced.NET component?
- Let’s say I have an existing application written using VB6 and this application utilizes Windows 2000 COM+ transaction services. How would you approach migrating this application to.NET?
- If I am developing an application that must accomodate multiple security levels though secure login and my ASP.NET web application is spanned across three web-servers (using round-robin load balancing). What would be the best approach to maintain login-in state for the users?
- What are ASP.NET web forms? How is this technology different than what is available though ASP(1.0-3.0)?
- How does VB.NET achieve polymorphism?
- How does C# achieve polymorphism?
- Can you explain what is Inheritance and an example in VB.NET and C# of when you might use it?
- Describe difference between inline and code-behind?
- What is loosely coupled solution in.NET?
- What is diffgram?
- Where would you use an iHTTPModule and what are the limitations of any approach you might take in implementing one?
- What are the Advantages and DisAdvantages of viewstate?
- Describe session handling in a webform, how does it work and what are the limitations?
- How would you get ASP.NET running in Apache web servers? Explain it’s limitations.
- What is MSIL and why should my developers need an appreciation of it if at all?
- Which methos do you invoke on the DataAdapter control to load your generated dataset with data?
- Can you edit data in Repeater control? How?
- Which template must you provide, in order to display data in a Repeater control?
- How can you provide an alternating color scheme in a Repeater control?
- What property must you set, and what method must you call in your code, in order to bind the data from some data source to the repeater control?
- What base class do all web forms inherit from?
- What method do you use to explicitly kill a user’s session? How?
- How do you turn off cookies for one page in your site? Give an example.
- Which two properties are on every validation control?
- What tags do you need to add within the asp:datagrid tags to bind columns manually? Give an example.
- How do you create a permanent cookie?
- What tag do you use to add a hyperlink column to the dataGrid?
- What is the standard you use to wrap up a call to a Web Service?
- Which method do you use to redirect the user to another page without performing a round trip to the client? How?
- What is the transport protocol you use to call a Seb Service SOAP?
- What does WSDL stand for?
- What property do you have to set to tell the grid which page to go to when using the Pager object?
- Where on the Internet would you look for Web Services?
- What tags do you need to add within the asp:datagrid tags to bind columns manually? How?
- Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?
- How is a property designated as read-only?
- Which control would you use if you needed to make sure the values in two different controls matched?
Posted in: Interview Questions General | Tags: interview questions and answers questions interview answers q&a .net c# c sharp xml winform rectangular window menu designer docking anchor dock deploy specify namespace config
You can use the Sysocmgr.exe tool at a command prompt to add or remove Windows components. You can use the following command-line switches with Sysocmgr.exe:
- /i:path to Sysoc.inf file, where path to Sysoc.inf file is the full path to the Sysoc.inf file, for example:
c:\windows\inf\sysoc.inf
- /u:path to answer file, where path to answer file is the full path to the answer file that contains a list of items to add or remove.
- /q - runs Sysocmgr.exe in quiet mode (without display pages)
- /r - suppresses reboot (if needed)
Note This procedure does not work and is unsupported with Microsoft Fax Service, Windows Media Player, COM+, and Distributed Transaction Coordinator. These are core components that are not removable. Additionally, in Windows 2000, this procedure does not work with the Microsoft Fax Service. This is because the Microsoft Fax Service is not an individual component in Windows 2000. Instead, the Microsoft Fax Service is a subcomponent of a larger group in Windows 2000.
The answer file can be any Windows answer file and only parses the [Components] and [NetOptionalComponents] sections. An example file is shown below:
[Components]
Netoc = on
Reminst = on
Paint = off
pinball = off
Solitaire = off
[NetOptionalComponents]
lpdsvc = 1
SimpTcp = 1
wins = 1
To start the installation or uninstallation of these components using Sysocmgr.exe, type the following command (file saved as c:\ocm.txt):
sysocmgr /i:%windir%\inf\sysoc.inf /u:c:\ocm.txt
For more information, please refer to the unattended documentation.
APPLIES TO
- Microsoft Windows 2000 Server
- Microsoft Windows 2000 Advanced Server
- Microsoft Windows 2000 Professional Edition
- Microsoft Windows 2000 Datacenter Server
- Microsoft Windows XP Home Edition
- Microsoft Windows XP Professional
- Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
- Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
- Microsoft Windows Server 2003, Standard Edition (32-bit x86)
- Microsoft Windows Server 2003, Web Edition
- Microsoft Windows Server 2003 Service Pack 1
- Microsoft Windows Server 2003, Datacenter Edition for Itanium-Based Systems
- Microsoft Windows Server 2003, Datacenter x64 Edition
- Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
- Microsoft Windows Server 2003, Enterprise x64 Edition
- Microsoft Windows Server 2003, Standard x64 Edition
Posted in: General | Tags: window suppresses sysocmgr.exe syscomgr components netoptionalcomponents simptcp wins netoc paint pinball
Beta to RC Changes – Turning Windows Features On or Off
The theme of “choice and control” has been applied in many aspects of how we have designed Windows 7. We’ve certainly received lots of positive feedback about the theme and about the choices we’ve made in the design, and we’ve also received a few suggestions for how we might continue to implement this theme in the future. We’ve received feedback for features that should be even more customizable (such as Explorer or the logon screen) or features that should be added to Windows (such as a PDF format reader, security tools, or disk utilities). And we’ve received feedback that some users might prefer to run Windows without certain features. This post is about a point of choice and control in the Windows 7 control panel called “Windows Features” which is where you can choose to turn various features of Windows on or off. This continues our discussion of changes we have made based on feedback from the Beta as we progress to the Release Candidate. This post is by Jack Mayo who is the group program manager for our Documents and Printing team and also worked on Internet Explorer 8. --Steven
“Turning Windows Features On or Off” has a long history in Windows, going back to the earliest days of the 32-bit code base. We’ve received a lot of suggestions about features that you would like to turn on or off using your own criteria for choice. For Windows 7 we’ve engineered a more significant list of features and worked to balance that list in light of the needs of the broad Windows platform as well. We want to provide choice while also making sure we do not compromise on compatibility by removing APIs provided for developers. We also want to strike the right balance for consumers in providing choice and balancing compatibility with applications and providing a consistent Windows experience.
We know many have specific ideas of what constitutes a “feature” or a “program” in Windows and what constitutes an identifiable “part” of the operating system, and yet we also know different people can have different points of view, often strongly held. Some might take an end-user approach and identify a feature based on a window or start menu shortcut. Some might take an approach based on one perspective of architectural subsystems, such as storage or security. Some might take an approach based on what to some are alternate choices to some similar functionality. All of these are valid in some context, but would not result in consistently identifying “features” considering these varied points of view. As engineers we know that no software system can be decomposed into an arbitrary set of layers or parts and any decomposition is likely to change over time.
We don’t want the discussion about this feature or these choices to digress into a philosophical discussion about the definition of an operating system, which is ultimately a challenging exercise (judging by the revision history on the community page), but we do want to improve a feature centered on helping to meet the feedback expressed by some over the summer when this blog started.
In the Release Candidate for Windows 7 we have extended the control panel called “Windows Features” which is available from the standard “Programs and Features” control panel (we often call this ARP, for the original name of Add/Remove Programs). This location is unchanged from Vista and XP, though the wording has been clarified. In Windows 7 if you bring up the Windows Features control panel by clicking on “Turn Windows Features on or off” (or just typing “Windows features” in the start menu) you will see the following in the Release Candidate (by default the hierarchy is not fully expanded, but in this screen shot I’ve expanded some elements for additional information):

For those familiar with the Vista version or the Beta version of this dialog you will notice the list has grown. Let’s talk about what we’ve added and briefly how it works.
If a feature is deselected, it is not available for use. This means the files (binaries and data) are not loaded by the operating system (for security-conscious customers) and not available to users on the computer. These same files are staged so that the features can easily be added back to the running OS without additional media. This staging is important feedback we have received from customers who definitely do not like to dig up the installation DVD.
For any of the features listed you can change the state to enable it or disable it. The Vista and Windows 7 beta control panel lists a wide range of features. Some are targeted towards Developers working on a client workstation (IIS, MSMQ, etc.), others are utilities for network administrators and enthusiasts (RSM, SNMP, Telnet, etc.), and some are features customers have asked us to make optional (Games, Fax and Scan, Tablet PC components).
In Windows 7 we are expanding the number of features you have control over in this regard, giving customers more control, flexibility and choice in managing the features available in this version of Windows. In addition to the features that were already available to turn on or off in Windows Vista, we’ve added the following features to the list in Windows 7:
- Windows Media Player
- Windows Media Center
- Windows DVD Maker
- Internet Explorer 8
- Windows Search
- Handwriting Recognition (through the Tablet PC Components option)
- Windows Gadget Platform
- Fax and Scan
- XPS Viewer and Services (including the Virtual Print Driver)
It is worth describing the details of “remove” since this too is a place where there are engineering and customer decisions to be made. We’ve already seen one decision which is to make sure we keep the features staged for future use so that a DVD is not required. A second decision is that we also continue to support the APIs available for features where these APIs are necessary to the functionality of Windows or where there are APIs that are used by developers that can be viewed as independent of the component. As many of you know these are often referred to as “dependencies” and with Windows the dependencies can run both internal to Windows and external for ISVs.
It should be no surprise, but when we develop new features in Windows we tend to use the underlying infrastructure and associated APIs rather than duplicate code which would create extra working set, slow performance, and increase the surface area that needs to be secured, etc. We all know code reuse is a good engineering practice. As a platform, Windows tends to emphasize the creation of APIs for many systems, even when those subsystems are viewed as part of a larger system. When we have APIs that are used, we faced the choice of breaking software that just expected those APIs to be there or to continue to support the API. When we continued to support the API our approach was to remove a feature by making sure that an end-user could not invoke the feature via traditional end-user mechanisms. These are often difficult decisions as we work to balance the expectations of developers, the shared desire to deliver a robust release of Windows 7, and to maintain the goals set out by the feature “Turn Windows Features On or Off”. Because there are so many combinations of dependencies just represented in this list, selecting some options might provide you with some explanation as to the challenges in selecting a combination (for example Windows Media Player and Windows Media Center share a lot of code so turning one off might introduce a pretty complex situation for the average end-user).
Finally, we know some have suggested that this set of choices be a “setup option”. Some operating systems do provide this type of setup experience. As we balanced feedback, the vast majority of feedback we have received was to streamline setup and to reduce the amount of potential complexity in getting a PC running. We chose to focus this feature on the post-setup experience for Windows 7.
Posted in: General | Tags: window windows features windows 7 release candidate rc