C# Interview QuestionsWord文件下载.docx
《C# Interview QuestionsWord文件下载.docx》由会员分享,可在线阅读,更多相关《C# Interview QuestionsWord文件下载.docx(14页珍藏版)》请在冰点文库上搜索。
clientside.thereisnoneedtogotovalidateuserinput.Ifitrelatestodatabasevalidationweneedtovalidateatserverside.
4.Whatdoesthe"
EnableViewState"
propertydo?
WhywouldIwantitonoroff?
ITkeepsthedataofthecontrolduringpostbacks.
ifweturnoffthevaluesshouldnotpopulateduringserverroundtrip.
5.WhatisthedifferencebetweenServer.TransferandResponse.Redirect?
WhywouldIchooseoneovertheother?
Server.Trnasferwillpreventroundtrip.itwillredirectpageswhichorinthesamedirectory.NOwaytopassthequerystrings.Thruhttpcontextwecanabletogetthepreviouspagecontrolvalues.
Response.Redirect:
Thereisaroundtriptoprocesstherequest.Wecanredirecttoanypageexternal/internalotherthanaspx.Wecanpassthequerystringthruwhichwecanmanagesessions.
6.Canyougiveanexampleofwhenitwouldbeappropriatetouseawebserviceasopposedtoanon-serviced.NETcomponent
WebservicesarebestsuiteforHetrogeniousenvironment.
RemotingisbestsuiteforHomogeniousenvironment.ThesystemsthatunderCLR.
7.Let'
ssayIhaveanexistingapplicationwrittenusingVisualStudio6(VB6,InterDev6)andthisapplicationutilizesWindows2000COM+transactionservices.Howwouldyouapproachmigratingthisapplicationto.NET
WeneedtohaveWrappertocommunicateCOMcomponentsin.net.andvisversa
CCW:
ComCallablewrapper.
RCW:
RUNtimecallablewrapper.
8.CanyouexplainthedifferencebetweenanADO.NETDatasetandanADORecordset?
\
DIsconnectedarchitechure.Maintainacerelationschemas.MUtilpletablegrouping.
Connectedone.
9.CanyougiveanexampleofwhatmightbebestsuitedtoplaceintheApplication_StartandSession_Startsubroutines?
APplication_startneedforglobalvariablewhichareavailableovertheapplication.
Sesssion_Start:
logindependent(userdependent)
10.IfI'
mdevelopinganapplicationthatmustaccomodatemultiplesecuritylevelsthoughsecureloginandmyASP.NETwebappplicationisspannedacrossthreeweb-servers(usinground-robbinloadbalancing)whatwouldbethebestapproachtomaintainlogin-instatefortheusers?
DatabaseSupport.
orThrustateservice.
11.WhatareASP.NETWebForms?
HowisthistechnologydifferentthanwhatisavailablethoughASP(1.0-3.0)?
ASP.Interprepter..usethescriptengine.
ASP.NetCompiled.
12.HowdoesVB.NET/C#achievepolymorphism?
Functionoverloading.
Operatoroverloading.
13.Canyouexplainwhatinheritanceisandanexampleofwhenyoumightuseit?
Heredity.
Usetheexistingfunctionalityalongwithitsownproperities.
14.HowwouldyouimplementinheritanceusingVB.NET/C#?
DerivedClass:
Basecalss
VB.NEt:
DerivedClassInheritsBaseclass
15.Whatsanassembly
ABasicunitofexecutablecode>
Whichcontains:
Manifest-Metadata
versioning,Calture,IL,Reference
16.Describethedifferencebetweeninlineandcodebehind-whichisbestinalooselycoupledsolutionTightlycoupled-INLINE
inlinefunctionbindatcompiletimecanwriteinaspxpagewithin<
%%>
.
17.Explainwhatadiffgramis,andagooduseforone
isanxmlgrammer.Ittalksaboutstateofnodeinxmlfile.
18.WherewouldyouuseaniHTTPModule,andwhatarethelimitationsofanyapproachyoumighttakeinimplementingone
PreprocessingbeforegoingtoIIS.
19.Whatarethedisadvantagesofviewstate/whatarethebenefits
ITcanbehacked.pagesizeisheavy.
20.HowwouldyougetASP.NETrunninginApachewebservers-whywouldyouevendothis?
----InstallMod_AspDotNet
AddattheendofC:
\ProgramFiles\ApacheGroup\Apache2\conf\httpd.confthefollowinglines
21.WhatsMSIL,andwhyshouldmydevelopersneedanappreciationofitifatall?
MicrosoftIntermediatelanguage.whichistheoutputforallthe.netsupportedlanguagesaftercompilationwillproduce.
Appreciationforcrosslanguagesupport.
22.InwhatorderdotheeventsofanASPXpageexecute.Asadeveloperisitimportanttounderstandtheseevents?
INIT,PageLoad,Prerender,UNload.
23.WhichmethoddoyouinvokeontheDataAdaptercontroltoloadyourgenerateddatasetwithdata?
Fill()
24.CanyoueditdataintheRepeatercontrol?
NO
25.Whichtemplatemustyouprovide,inordertodisplaydatainaRepeatercontrol?
ITemtemplate
26.HowcanyouprovideanalternatingcolorschemeinaRepeatercontrol?
AlternateItemTemplate
27.Whatpropertymustyouset,andwhatmethodmustyoucallinyourcode,inordertobindthedatafromsomedatasourcetotheRepeatercontrol?
Datasource,
DataBind
28.WhatbaseclassdoallWebFormsinheritfrom?
System.Web.UI.Page
29.Whatmethoddoyouusetoexplicitlykillauserssession?
abondon()
30.Howdoyouturnoffcookiesforonepageinyoursite?
disablecookies.
31.Whichtwopropertiesareoneveryvalidationcontrol?
controltovalidate,errormessage
32.Whattagsdoyouneedtoaddwithintheasp:
datagridtagstobindcolumnsmanually?
autogeneratedcolumnsissettofalse
33.Howdoyoucreateapermanentcookie?
Cooke=newcookie().
cooke.adddate.
34.WhattagdoyouusetoaddahyperlinkcolumntotheDataGrid?
hyperlinkcolumn
35.Whichmethoddoyouusetoredirecttheusertoanotherpagewithoutperformingaroundtriptotheclient?
Server.Transfer
36.WhatisthetransportprotocolyouusetocallaWebserviceSOAP
http
37.TrueorFalse:
AWebservicecanonlybewrittenin.NET
false
38.WhatdoesWSDLstandfor?
webservicediscriptionlanguage.itisusedtogenerateforproxy(serverobject)
39.WhatpropertydoyouhavetosettotellthegridwhichpagetogotowhenusingthePagerobject?
PageIndex.
40.WhereontheInternetwouldyoulookforWebservices?
UDDI
41.Whattagsdoyouneedtoaddwithintheasp:
datagridtagstobindcolumnsmanually.
Autogeneratecolumns
42.WhichpropertyonaComboBoxdoyousetwithacolumnname,priortosettingtheDataSource,todisplaydatainthecombobox?
datatext
datavalue
43.Howisapropertydesignatedasread-only?
get
44.Whichcontrolwouldyouuseifyouneededtomakesurethevaluesintwodifferentcontrolsmatched?
comparefiledvalidator
45.TrueorFalse:
TotestaWebserviceyoumustcreateawindowsapplicationorWebapplicationtoconsumethisservice?
no
46.Howmanyclassescanasingle.NETDLLcontain?
asmanyasuwant..
47.Whatisserialization,howitworksin.NET?
TheprimarypurposeofXMLserializationinthe.NETFrameworkistoenabletheconversionofXMLdocumentsandstreamstocommonlanguageruntimeobjectsandviceversa.SerializationofXMLtocommonlanguageruntimeobjectsenablesonetoconvertXMLdocumentsintoaformwheretheyareeasiertoprocessusingconventionalprogramminglanguages.Ontheotherhand,serializationofobjectstoXMLfacilitatespersistingortransportingthestateofsuchobjectsinanopen,standardscompliantandplatformagnosticmanner.
48.HowmanyarraytypesdoesC#provide?
Juggedarray,tablearray,…
GeneralQuestions
1.DoesC#supportmultiple-inheritance?
No.
2.Whoisaprotectedclass-levelvariableavailableto?
Itisavailabletoanysub-class(aclassinheritingthisclass).
3.Areprivateclass-levelvariablesinherited?
Yes,buttheyarenotaccessible.
Althoughtheyarenotvisibleoraccessibleviatheclassinterface,theyareinherited.
4.Describetheaccessibilitymodifier“protectedinternal”.
Itisavailabletoclassesthatarewithinthesameassemblyandderivedfromthespecified
baseclass.
5.What’sthetop.NETclassthateverythingisderivedfrom?
System.Object.
6.Whatdoesthetermimmutablemean?
Thedatavaluemaynotbechanged.
Note:
Thevariablevaluemaybechanged,buttheoriginalimmutabledatavaluewasdiscardedandanewdatavaluewascreatedinmemory.
7.What’sthedifferencebetweenSystem.StringandSystem.Text.StringBuilderclasses?
System.Stringisimmutable.
System.StringBuilderwasdesignedwiththepurposeofhavingamutablestringwhereavarietyofoperationscanbeperformed.
8.What’stheadvantageofusingSystem.Text.StringBuilderoverSystem.String?
StringBuilderismoreefficientincaseswherethereisalargeamountofstringmanipulation.
Stringsareimmutable,soeachtimeastringischanged,
anewinstanceinmemoryiscreated.
9.CanyoustoremultipledatatypesinSystem.Array?
10.What’sthedifferencebetweentheSystem.Array.CopyTo()andSystem.Array.Clone()?
TheClone()methodreturnsanewarray(ashallowcopy)objectcontainingalltheelementsintheoriginalarray.
TheCopyTo()methodcopiestheelementsintoanotherexistingarray.
Bothperformashallowcopy.
Ashallowcopymeansthecontents(eacharrayeleme