none
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in System.Windows.ni.dll

    问题

  • Hello

    I am developing the small word puzzle game

    Game is computer will list one word and in response user will also list one word starting from the last letter of computer

    Here is the UI Part for the game

    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
                <TextBox x:Name="txtinput" HorizontalAlignment="Left" Height="72" Margin="-10,450,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="399" Foreground="#DEC32B2B"/>
                <Button x:Name="btngo" Content="GO" HorizontalAlignment="Left" Margin="375,452,-8,0" VerticalAlignment="Top" Width="89" Foreground="#DE700D0D" Click="btngo_Click"/>
                <phone:LongListSelector x:Name="llstdata" HorizontalAlignment="Left" Height="419" Margin="10,10,0,0" VerticalAlignment="Top" Width="436">
                    <phone:LongListSelector.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Height="40" Width="40" Source="/Assets/ccc.jpg"/>
                                <TextBlock Text="{Binding wordContent}" Margin="20,0,0,0" FontSize="28"/>
                            </StackPanel>
                        </DataTemplate>
                    </phone:LongListSelector.ItemTemplate>
                </phone:LongListSelector>
    
    
            </Grid>
            <TextBlock HorizontalAlignment="Left" Margin="84,0,0,0" TextWrapping="Wrap" Text="Word Puzzle" VerticalAlignment="Top" Height="84" Width="286" FontSize="48" FontWeight="Bold">
                <TextBlock.Foreground>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFD1C9C9" Offset="0.016"/>
                        <GradientStop Color="#FFE60707" Offset="1"/>
                        <GradientStop Color="#FF5BCADC" Offset="0.737"/>
                    </LinearGradientBrush>
                </TextBlock.Foreground>
            </TextBlock>
    
    
        </Grid>
    
    and here is the code behind

    public partial class MainPage : PhoneApplicationPage
        {
            Dictionary<string, Int16> puzzle = new Dictionary<string, Int16>();
            List<string> allword;
            string cword;
            List<CurrentWord> puzzleWord = new System.Collections.Generic.List<CurrentWord>();
            string filecontent;
            // Constructor
            public MainPage()
            {
                InitializeComponent();
                allword = new List<string>();
    
                // Sample code to localize the ApplicationBar
                //BuildLocalizedApplicationBar();
            }
    
            private void PhoneApplicationPage_Loaded_1(object sender, RoutedEventArgs e)
            {
                try
                {
                    //using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
                    //{
                    //    if (storage.FileExists("sai.txt"))
                    //    {
                    //        IsolatedStorageFileStream file = storage.OpenFile("sai.txt", FileMode.Open, FileAccess.Read);
                    //        StreamReader sr = new StreamReader(file);
                    //        filecontent = sr.ReadToEnd();
                    //        sr.Close();
                    //        file.Close();
    
                    //    }
                    filecontent = "crow,crown,crowd,crib,desk,dime,dirt,dress,fang,field,flag,flower,fog,game,heat,hill,home,horn,hose,joke,juice,kite,lake,maid,mask,mice,milk,mint,meal,meat,moon,mother,morning,name,nest,nose,pear,pen,pencil,plant,rain,river,road,rock,room,rose,seed,shape,shoe,shop,show,sink,snail,snake,snow,soda,sofa,star,step,stew,stove,straw,string,summer,swing,table,tank,team,tent,test,toes,tree,vest,water,wing,winter,woman,women,alarm,animal,aunt,bait,balloon,bath,bead,beam,bean,bedroom,boot,bread,brick,brother,camp,chicken,children,crook,deer,dock,doctor,downtown,drum,dust,eye,family,father,fight,flesh,food,frog,goose,grade,grass,hook,horse,jail,jam,kiss,kitten,light,loaf,lock,lunch,lunchroom,meal,mother,notebook,owl,pail,parent,park,plot,rabbit,rake,robin,sack,sail,scale,sea,sister,soap,song,spark,space,spoon,spot,spy,summer,tiger,toad,town,trail,tramp,tray,trick,trip,uncle,vase,winter,water,week,wheel,wish,wool,yard,zebra,actor,airplane,airport,army,baseball,beef,birthday,boy,brush,bushes,butter,cast,cave,cent,cherries,cherry,cobweb,coil,cracker,dinner,eggnog,elbow,face,fireman,flavor,gate,glove,glue,goldfish,goose,grain,hair,haircut,hobbies,holiday,hot,jelly,fish,ladybug,mailbox,number,oatmeal,pail,pancake,pear,pest,popcorn,queen,quicksand,quiet,quilt,rainstorm,scarecrow,scarf,stream,street,sugar,throne,toothpaste,twig,volleyball,wood,wrench,advice,anger,answer,apple,arithmetic,badge,basket,basketball,battle,beast,beetle,beggar,brain,branch,bubble,bucket,cactus,cannon,cattle,celery,cellar,cloth,coach,coast,crate,cream,daughter,donkey,drug,earthquake,feast,fifth,finger,flock,frame,furniture,geese,ghost,giraffe,governor,honey,hope,hydrant,icicle,income,island,jeans,judge,lace,lamp,lettuce,marble,month,north,ocean,patch,plane,poison,riddle,rifle,scale,seashore,sheet,sidewalk,skate,slave,sleet,smoke,stage,station,thrill,throat,throne,title,turkey,underwear,vacation,vegetable,visitor,voyage,year,able,achieve,acoustics,action,activity,apparel,beginner,believe,bomb,border,boundary,breakfast,cabbage,cable,calendar,caption,carpenter,cemetery,channel,circle,creator,creature,faucet,feather,friction,fruit,fuel,galley,guide,guitar,health,heart,idea,kitten,laborer,language,lawyer,linen,locket,lumber,magic,minister,mitten,money,mountain,music,partner,passenger,pickle,picture,plantation,plastic,pleasure,pocket,police,pollution,railway,recess,reward,route,scene,scent,squirrel,stranger,suit,sweater,temper,territory,texture,thread,treatment,veil,vein,volcano,wealth,weather,wilderness,wren,wrist,writer,account,achiever,acoustics,act,action,activity,actor,addition,adjustment,advertisement,advice,aftermath,afternoon,afterthought,agreement,air,airplane,airport,alarm,amount,amusement,anger,angle,animal,answer,ant,ants,apparatus,apparel,apple,apples,appliance,approval,arch,argument,arithmetic,arm,army,art,attack,attempt,attention,attraction,aunt,authority,babies,baby,back,badge,bag,bait,balance,ball,balloon,balls,banana,band,base,base,ball,basin,basket,basketball,bat,bath,battle,bead,beam,bean,bear,bears,beast,bed,bedroom,beds,bee,beef,beetle,beggar,beginner,behavior,belief,believe,bell,bells,berry,bike,bikes,bird,birds,birth,birthday,bit,bite,blade,blood,blow,board,boat,boats,body,bomb,bone,book,books,boot,border,bottle,boundary,box,boy,boys,brain,brake,branch,brass,bread,breakfast,breath,brick,bridge,brother,brothers,brush,bubble,bucket,building,bulb,bun,burn,burst,bushes,business,butter,button,cabbage,cable,cactus,cake,cakes,calculator,calendar,camera,camp,can,cannon,canvas,cap,caption,car,card,care,carpenter,carriage,cars,cart,cast,cat,cats,cattle,cause,cave,celery,cellar,cemetery,cent,chain,chair,chairs,chalk,chance,change,channel,cheese,cherries,cherry,chess,chicken,chickens,children,chin,church,circle,clam,class,clock,clocks,cloth,cloud,clouds,clover,club,coach,coal,coast,coat,cobweb,coil,collar,color,comb,comfort,committee,company,comparison,competition,condition,connection,control,cook,copper,copy,cord,cork,corn,cough,country,cover,cow,cows,crack,cracker,crate,crayon,cream,creator,creature,credit,crib,crime,crook,crow,crowd,crown,crush,cry,cub,cup,current,curtain,curve,cushion,dad,daughter,day,death,debt,decision,deer,degree,design,desire,desk,destruction,detail,development,digestion,dime,dinner,dinosaurs,direction,dirt,discovery,discussion,disease,disgust,distance,distribution,division,dock,doctor,dog,dogs,doll,dolls,donkey,door,downtown,drain,drawer,dress,drink,driving,drop,drug,drum,duck,ducks,dust,ear,earth,earthquake,edge,education,effect,egg,eggnog,eggs,elbow,end,engine,error,event,example,exchange,existence,expansion,experience,expert,eye,eyes,face,fact,fairies,fall,family,fan,fang,farm,farmer,father,father,faucet,fear,feast,feather,feeling,feet,fiction,field,fifth,fight,finger,finger,fire,fireman,fish,flag,flame,flavor,flesh,flight,flock,floor,flower,flowers,fly,fog,fold,food,foot,force,fork,form,fowl,frame,friction,friend,friends,frog,frogs,front,fruit,fuel,furniture,game,garden,gate,geese,ghost,giants,giraffe,girl,girls,glass,glove,glue,goat,gold,goldfish,goodbye,goose,government,governor,grade,grain,grandfather,grandmother,grape,grass,grip,ground,group,growth,guide,guitar,gun,hair,haircut,hall,hammer,hand,hands,harbor,harmonyhat,hate,head,health,hearing,heart,heat,help,hen,hill,history,hobbies,hole,holiday,home,honey,hook,hope,horn,horse,horses,hose,hospital,hot,hour,house,houses,humor,hydrant,ice,icicle,idea,impulse,income,increase,industry,ink,insect,instrument,insurance,interest,invention,iron,island,jail,jam,jar,jeans,jelly,jellyfish,jewel,join,joke,journey,judge,juice,jump,kettle,key,kick,kiss,kite,kitten,kittens,kitty,knee,knife,knot,knowledge,laborer,lace,ladybug,lake,lamp,land,language,laugh,lawyer,lead,leaf,learning,leather,leg,legs,letter,letters,lettuce,level,library,lift,light,limit,line,linen,lip,liquid,list,lizards,loaf,lock,locket,look,loss,love,low,lumber,lunch,lunchroom,man,map,mark,mask,mass,match,meal,meat,metal,mice,milk,mind,min,mist,mom,money,month,moon,mouth,move,muscle,music,nail,name,neck,need,nerve,nest,net,news,nose,note,nut,ocean,offer,oil,order,oven,owl,owner,page,pail,pain,paint,pan,paper,park,part,party,paste,patch,peace,pear,pen,pest,pet,pets,pie,pies,pig,pigs,pin,pipe,place,plane,planes,plant,plants,plate,play,pot,powder,power,price,print,prose,pull,pump,push,queen,quiet,quill,quilt,rail,rain,rake,range,rat,rate,ray,rest,rice,rifle,ring,rings,river,road,robin,rock,rod,roll,roof,room,root,rose,route,rub,rule,run,sack,sail,salt,sand,scale,scarf,scene,scent,school,screw,sea,seat,seed,self,sense,shade,shake,shame,shape,sheep,sheet,shelf,ship,shirt,shock,shoe,shoes,shop,show,side,sign,silk,silver,sink,size,skate,skin,skirt,sky,slave,sleep,sleet,slip,slope,smash,smell,smile,smoke,snail,snake,snakes,sneeze,snow,soap,sock,soda,sofa,son,song,songs,sort,sound,soup,space,spade,spark,spoon,spot,spy,stage,stamp,star,start,steam,steel,stem,step,stew,stick,stone,stop,store,story,stove,suit,sun,swim,swing,table,tail,talk,tank,taste,tax,team,teeth,temper,tent,test,tiger,time,tin,title,toad,toe,toes,tooth,top,touch,town,toy,toysztrade,trail,train,tramp,tray,tree,trees,trick,trip,truck,tub,turn,twig,twist,uncle,unit,use,value,van,vase,veil,vein,verse,vest,view,voice,walk,wall,war,wash,waste,watch,water,wave,waves,wax,way,week,wheel,whip,wind,wine,wing,wire,wish,woman,women,wood,wool,word,work,worm,wound,wren,wrist,yak,yam,yard,yarn,year,zebra,zinc,zoo,see,need,know,would,find,take,want,does,learn,become,come,include,really,thank,provide,create,add,understand,consider,choose,develop,remember,definition,determine,grow,allow,supply,bring,improve,maintain,begin,exist,tend,enjoy,perform,decide,identify,continue,protect,require,occur,write,approach,avoid,prepare,build,achieve,believe,receive,seem,discuss,realize,contain,follow,refer,solve,describe,prefer,prevent,discover,ensure,expect,invest,reduce,speak,appear,explain,explore,involve,lose,afford,agree,hear,remain,represent,apply,forget,recommend,rely,vary,generate,obtain,accept,communicate,complain,depend,enter,happen,indicate,suggest,survive,appreciate,compare,imagine,manage,differ,encourage,expand,prove,react,recognize,relax,replace,borrow,earnemphasize,enable,operate,reflect,send,anticipate,assume,engage,enhance,examine,install,participate,intend,introduce,relate,settle,smell,assure,attract,distribute,overcome,owe,succeed,suffer,throw,acquire,adapt,adjust,argue,arise,confirm,encouraging,incorporate,justify,organize,ought,possess,relieve,retain,shut,calculate,compete,consult,deliver,extend,investigate,negotiate,qualify,retire,rid,weigh,arrive,attach,behave,celebrate,convince,disagree,establish,ignore,imply,insist,pursue,remaining,specify,warn,accuse,admire,admit,adopt,announce,apologize,approve,attend,belong,commit,criticize,deserve,destroy,hesitate,illustrate,inform,manufacturing,persuade,pour,propose,remind,shall,submit,suppose,translate,be,have,use,make,look,help,go,being,think,read,keep,start,give,play,feel,put,set,change,say,cut,show,try,check,call,move,pay,let,increase,turn,ask,buy,guard,hold,offer,travel,cook,dance,excuse,live,purchase,deal,mean,fall,produce,search,spend,talk,upset,tell,cost,drive,support,remove,return,run,appropriate,reserve,leave,reach,rest,serve,watch,charge,break,stay,visit,affect,cover,report,rise,walk,pick,lift,mix,stop,teach,concern,fly,born,gain,save,stand,fail,lead,listen,worry,express,handle,meet,release,sell,finish,press,ride,spread,spring,wait,display,flow,hit,shoot,touch,cancel,cry,dump,push,select,conflict,die,eat,fill,jump,kick,pass,pitch,treat,abuse,beat,burn,deposit,print,raise,sleep,advance,connect,consist,contribute,draw,fix,hire,join,kill,sit,tap,win,attack,claim,drag,drink,guess,pull,wear(ver,wonder,count,doubt,feed,impress,repeat,seek,sing,slide,strip,wish,collect,combine,command,dig,divide,hang,hunt,march,mention,survey,tie,escape,expose,gather,hate,repair,scratch,strike,employ,hurt,laugh,lay,respond,split,strain,struggle,swim,train,wash,waste,convert,crash,fold,grab,hide,miss,permit,quote,recover,resolve,roll,sink,slip,suspect,swing,twist,concentrate,estimate,prompt,refuse,regret,reveal,rush,shake,shift,shine,steal,suck,surround,bear,dare,delay,hurry,invite,kiss,marry,pop,pray,pretend,punch,quit,reply,resist,rip,rub,smile,spell,stretch,tear,wake,wrap,was,like,even,film,water,been,well,were,example,own,study,must,form,air,place,number,part,field,fish,process,heat,hand,experience,job,book,end,point,type,value,body,market,guide,interest,state,radio,course,company,price,size,card,list,mind,trade,line,care,group,risk,word,force,light,name,school,amount,order,practice,research,sense,service,piece,web,boss,sport,page,term,test,answer,sound,focus,matter,soil,board,oil,picture,access,garden,open,range,rate,reason,according,site,demand,exercise,image,case,cause,coast,age,boat,record,result,section,building,mouse,cash,class,dry,plan,store,tax,involved,side,space,rule,weather,figure,man,model,source,earth,program,design,feature,purpose,question,rock,act,birth,dog,object,scale,sun,fit,note,profit,related,rent,speed,style,war,bank,content,craft,bus,exchange,eye,fire,position,pressure,stress,advantage,benefit,box,complete,frame,issue,limited,step,cycle,face,interested,metal,paint,review,room,screen,structure,view,account,ball,concerned,discipline,ready,share,balance,bit,black,bottom,gift,impact,machine,shape,tool,wind,address,average,career,culture,pot,sign,table,task,condition,contact,credit,egg,hope,network,separate,attempt,date,effect,link,perfect,post,star,voice,challenge,friend,warm,brush,couple,exit,experienced,function,lack,plant,spot,summer,taste,theme,track,wing,brain,button,click,correct,desire,fixed,foot,gas,influence,notice,rain,wall,base,damage,distance,pair,staff,sugar,target,text,author,complicated,discount,file,ground,lesson,officer,phase,reference,register,secure,sky,stage,stick,title,trouble,advanced,bowl,bridge,campaign,club,edge,evidence,fan,letter,lock,option,organized,pack,park,quarter,skin,sort,weight,baby,carry,dish,exact,factor,fruit,muscle,traffic,trip,appeal,chart,gear,land,log,lost,net,season,spirit,tree,wave,belt,bench,closed,commission,copy,drop,firm,frequent,progress,project,stuff,ticket,tour,angle,blue,breakfast,doctor,dot,dream,essay,father,fee,finance,juice,luck,milk,mixed,mouth,pipe,please,stable,storm,team,amazing,bat,beach,blank,busy,catch,chain,cream,crew,detail,detailed,interview,kid,mark,pain,pleasure,score,screw,sex,sharp,shop,shower,suit,tone,window,wise,band,bath,block,bone,calendar,candidate,cap,coat,contest,court,cup,district,finger,garage,guarantee,hole,hook,implement,layer,lecture,lie,married,narrow,nose,partner,profile,rice,schedule,telephone,tip,bag,battle,bed,bill,bother,cake,code,curve,dimension,ease,farm,fight,gap,grade,horse,host,husband,loan,mistake,nail,noise,occasion,package,pause,phrase,race,sand,sentence,shoulder,smoke,stomach,string,surprised,towel,vacation,wheel,arm,associate,bet,blow,border,branch,breast,buddy,bunch,chip,coach,cross,document,draft,dust,floor,golf,habit,iron,judge,knife,landscape,league,mail,mess,parent,pattern,pin,pool,pound,request,salary,shame,shelter,shoe,tackle,tank,trust,assist,bake,bar,bell,bike,blame,brick,chair,closet,clue,collar,comment,conference,devil,diet,fear,fuel,glove,jacket,lunch,monitor,mortgage,nurse,pace,panic,peak,provided,reward,row,sandwich,shock,spite,spray,surprise,till,transition,weekend,yard,alarm,bend,bicycle,bite,blind,bottle,cable,candle,clerk,cloud,concert,counter,dirty,flower,grandfather,harm,knee,lawyer,load,loose,mirror,neck,pension,plate,pleased,proposed,ruin,ship,skirt,slice,snow,stroke,switch,tired,trash,tune,worried,zone,anger,award,bid,boot,bug,camp,candy,carpet,cat,champion,channel,clock,comfort,cow,crack,disappointed,empty,engineer,entrance,fault,grass,guy,highlight,island,joke,jury,leg,lip,mate,nerve,passage,pen,pride,priest,promise,resort,ring,roof,rope,sail,scheme,script,slight,smart,sock,station,toe,tower,truck,witness,people,history,way,art,money,world,information,map,two,family,government,health,system,computer,meat,year,thanks,music,person,reading,method,data,food,theory,law,bird,literature,problem,software,control,knowledge,power,ability,economics,love,internet,television,science,library,nature,fact,product,idea,temperature,investment,area,society,activity,story,industry,media,thing,oven,community,safety,quality,development,language,management,player,variety,video,week,security,country,exam,movie,organization,equipment,physics,analysis,policy,series,thought,basis,boyfriend,direction,strategy,technology,army,camera,freedom,paper,environment,child,instance,month,truth,marketing,university,writing,article,department,difference,goal,news,audience,fishing,growth,income,marriage,user,combination,failure,meaning,medicine,philosophy,teacher,communication,night,chemistry,disease,disk,energy,nation,road,role,soup,advertising,location,success,addition,apartment,education,math,moment,painting,politics,attention,decision,event,property,shopping,student,wood,competition,distribution,entertainment,office,population,president,unit,category,cigarette,context,introduction,opportunity,performance,driver,flight,length,magazine,newspaper,relationship,teaching,cell,dealer,debate,finding,lake,member,message,phone,scene,appearance,association,concept,customer,death,discussion,housing,inflation,insurance,woman,advice,blood,effort,expression,importance,opinion,payment,reality,responsibility,situation,skill,statement,wealth,application,city,county,depth,estate,foundation,grandmother,heart,perspective,photo,recipe,studio,topic,collection,depression,imagination,passion,percentage,resource,setting,ad,agency,college,connection,criticism,debt,description,memory,patience,secretary,solution,administration,aspect,attitude,director,personality,psychology,recommendation,response,selection,storage,version,alcohol,argument,complaint,contract,emphasis,highway,loss,membership,possession,preparation,steak,union,agreement,cancer,currency,employment,engineering,entry,interaction,limit,mixture,preference,region,republic,seat,tradition,virus,actor,classroom,delivery,device,difficulty,drama,election,engine,football,guidance,hotel,match,owner,priority,protection,suggestion,tension,variation,anxiety,atmosphere,awareness,bread,climate,comparison,confusion,construction,elevator,emotion,employee,employer,guest,height,leadership,mall,manager,operation,recording,respect,sample,transportation,boring,charity,cousin,disaster,editor,efficiency,excitement,extent,feedback,guitar,homework,leader,mom,outcome,permission,presentation,promotion,reflection,refrigerator,resolution,revenue,session,singer,tennis,basket,bonus,cabinet,childhood,church,clothes,coffee,dinner,drawing,hair,hearing,initiative,judgment,lab,measurement,mode,mud,orange,poetry,police,possibility,procedure,queen,ratio,relation,restaurant,satisfaction,sector,signature,significance,song,tooth,town,vehicle,volume,wife,accident,airport,appointment,arrival,assumption,baseball,chapter,committee,conversation,database,enthusiasm,error,explanation,farmer,gate,girl,hall,historian,hospital,injury,instruction,maintenance,manufacturer,meal,perception,pie,poem,presence,proposal,reception,replacement,revolution,river,son,speech,tea,village,warning,winner,workre,writer,assistance,breath,buyer,chest,chocolate,conclusion,contribution,cookie,courage,dad,desk,drawer,establishment,examination,garbage,grocery,honey,impression,improvement,independence,insect,inspection,inspector,king,ladder,menu,penalty,piano,potato,profession,professor,quantity,reaction,requirement,salad,sister,supermarket,tongue,weakness,wedding,affair,ambition,analyst,apple,assignment,assistant,bathroom,bedroom,beer,birthday,celebration,championship,cheek,client,consequence,departure,diamond,dirt,ear,fortune,friendship,funeral,gene,girlfriend,hat,indication,intention,lady,midnight,negotiation,obligation,passenger,pizza,platform,poet,pollution,recognition,reputation,shirt,sir,speaker,stranger,surgery,sympathy,tale,throat,trainer,uncle,youth,time,work,film,water,example,while,business,study,game,life,form,air,day,place,number,part,field,fish,back,process,heat,hand,experience,job,book,end,point,type,home,economy,value,body,market,guide,interest,state,radio,course,company,price,size,card,list,mind,trade,line,care,group,risk,word,fat,force,key,light,training,name,school,top,amount,level,order,practice,research,sense,service,piece,web,boss,sport,fun,house,page,term,test,answer,sound,focus,matter,kind,soil,board,oil,picture,access,garden,range,rate,reason,future,site,demand,exercise,image,case,cause,coast,action,age,bad,boat,record,result,section,building,mouse,cash,class,nothing,period,plan,store,tax,side,subject,space,rule,stock,weather,chance,figure,man,model,source,beginnig,earth,program,chicken,design,feature,head,material,purpose,question,rock,salt,act,birth,car,dog,object,scale,sun,note,profit,rent,speed,style,war,bank,craft,half,inside,outside,standard,bus,exchange,eye,fire,position,pressure,stress,advantage,benefit,box,frame,issue,step,cycle,face,item,metal,paint,review,room,screen,structure,view,account,ball,discipline,medium,share,balance,bit,black,bottom,choice,gift,impact,machine,shape,tool,wind,address,average,career,culture,morning,pot,sign,table,task,condition,contact,credit,egg,hope,ice,network,north,square,attempt,date,effect,link,post,star,voice,capital,challenge,friend,self,shot,brush,couple,exit,front,function,lack,plant,plastic,spot,summer,taste,theme,track,wing,brain,button,click,desire,foot,gas,influence,mood,notice,rain,wall,base,damage,distance,feeling,pair,saving,staff,sugar,target,text,animal,author,budget,discount,file,ground,lesson,minute,officer,phase,reference,register,sky,stage,stick,title,trouble,bowl,bridge,campaign,character,club,edge,evidence,fan,letter,lock,maximum,novel,option,pack,park,plenty,quarter,skin,sort,weight,baby,background,carry,dish,factor,fruit,glass,joint,master,muscle,red,strength,traffic,trip,vegetable,appeal,chart,gear,ideal,kitchen,land,log,mother,net,party,principle,relative,sale,season,signal,spirit,street,tree,wave,belt,bench,copy,drop,minimum,path,progress,project,sea,south,status,suff,tour,angle,blue,breakfast,confidence,daughter,degree,doctor,dot,dream,duty,essay,father,fee,hour,juice,luck,milk,mouth,peace,pipe,stable,storm,substance,team,trick,afternoon,bat,beach,blank,catch,chain,consideration,cream,crew,detail,gold,interview,kid,mark,mission,pain,pleasure,score,screw,shop,shower,suit,tone,window,agent,band,bath,block,bone,calendar,candidate,cat,coat,contest,corner,court,cup,district,door,east,finger,garage,guarantee,hole,hook,implement,layer,lecture,lie,manner,meeting,nose,parking,partner,profile,rice,routine,schedule,swimming,telephone,tip,winter,airline,bag,battle,bed,bill,bother,cake,code,curve,designer,dimension,dress,ease,emergency,evening,extension,farm,fight,gap,grade,holiday,horror,horse,host,husband,loan,mistake,mountain,nail,noise,occasion,package,patient,pause,phrase,proof,race,relief,sand,sentence,shoulder,smoke,string,tourist,towel,vacation,west,wheel,wine,arm,aside,invite,irritate,itch,jail,jam,jog,join,joke,judgejugglejump,justify,keep,kept,kick,kill,kiss,kneel,knit,knock,knot,know,label,land,last,laugh,launch,lay,lead,lean,leap,learn,leave,lecture,led,lend,let,level,license,lick,lie,lifted,light,lighten,like,list,listen,live,load,locate,lock,log,long,look,lose,love,maintain,make,man,manage,manipulate,manufacture,map,march,mark,market,marry,match,mate,matter,mean,measure,meddle,mediate,meet,melt,melt,memorize,mend,mentor,milk,mine,mislead,miss,misspell,mistake,mix,moan,model,modify,monitor,moor,motivate,mourn,move,mow,muddle,mug,multiply,murder,nail,name,navigate,need,negotiate,nest,nod,nominate,normalize,note,notice,number,obey,object,observe,obtain,occur,offend,offer,officiate,open,operate,order,organize,oriented,originate,overcome,overdo,overdraw,overflow,overhear,overtake,overthrow,owe,own,pack,paddle,paint,park,part,participate,pass,paste,pat,pause,pay,peck,pedal,peel,peep,perceive,perfect,perform,permit,persuade,phone,photograph,pick,pilot,pinch,pine,pinpoint,pioneer,place,plan,plant,play,plead,please,plug,point,poke,polish,pop,possess,post,pour,practice,praised,pray,preach,precede,predict,prefer,prepare,prescribe,present,preserve,preset,preside,press,pretend,prevent,prick,print,process,procure,produce,profess,program,progress,project,promise,promote,proofread,propose,protect,prove,provide,publicize,pull,pump,punch,puncture,punish,purchase,push,put,qualify,question,queue,quit,race,radiateerain,raise,rank,rate,reach,read,realign,realize,reason,receive,recognize,recommend,reconcile,record,recruit,reduce,refer,reflect,refuse,regret,regulate,rehabilitate,reign,reinforce,reject,rejoice,relate,relax,release,rely,remain,remember,remind,remove,render,reorganize,repair,repeat,replace,reply,report,represent,reproduce,request,rescue,research,resolve,respond,restored,restructure,retire,retrieve,return,review,revise,rhyme,rid,ride,ring,rinse,rise,risk,rob,rock,roll,rot,rub,ruin,rule,run,rush,sack,sail,satisfy,save,saw,say,scare,scatter,schedule,scold,scorch,scrape,scratch,scream,screw,scribble,scrub,seal,search,secure,see,seek,select,sell,send,sense,separate,serve,service,set,settle,sew,shade,shake,shape,share,shave,shear,shed,shelter,shine,shiver,shock,shoe,shoot,shop,show,shrink,shrug,shut,sigh,sign,signal,simplify,sin,sing,sink,sip,sit,sketch,ski,skip,slap,slay,sleep,slide,sling,slink,slip,slit,slow,smash,smell,smile,smite,smoke,snatch,sneak,sneeze,sniff,snore,snow,soak,solve,soothe,soothsay,sort,sound,sow,spare,spark,sparkle,speak,specify,speed,spell,spend,spill,spin,spit,split,spoil,spot,spray,spread,spring,sprout,squash,squeak,squeal,squeeze,stain,stamp,stand,stare,start,stay,steal,steer,step,stick,stimulate,sting,stink,stir,stitch,stop,store,strap,streamline,strengthen,stretch,stride,strike,string,strip,strive,stroke,structure,study,stuff,sublet,subtract,succeed,suffer,suggest,suit,summarize,supervise,supply,support,suppose,surprise,surround,suspect,suspend,swear,sweat,sweep,swell,swim,swing,switch,symbolize,synthesize,systemize,undergo,understand,undertake,undress,unfasten,unify,unite,unlock,unpack,untidy,update,upgrade,uphold,upset,use,utilize,undergo,understand,undertake,undress,unfasten,unify,unite,unlock,unpack,untidy,update,upgrade,uphold,upset,use,utilize,wail,wait,wake,walk,wander,want,warm,warn,wash,waste,watch,water,wave,wear,weave,wed,weep,weigh,welcome,wend,wet,whine,whip,whirl,whisper,whistle,win,wind,wink,wipe,wish,withdraw,withhold,withstand,wobble,wonder,work,worry,wrap,wreck,wrestle,wriggle,wring,write,yawn,yell,zip,zoom,all,another,any,anybody,anyone,anything,several,she,some,somebody,someone,something,each,each,other,either,everybody,everyone,everything,many,me,mine,more,most,much,my,myself,that,their,theirs,them,themselves,these,they,this,those,few,neither,noone,nobody,none,nothing,what,whatever,which,whichever,who,whoever,whom,whomever,whose,one,another,other,others,our,ours,ourselves,you,your,yours,yourself,yourselves,abnormally,absentmindedly,accidentally,acidly,actually,adventurously,afterwards,almost,always,angrily,annually,anxiously,arrogantly,awkwardly,badly,bashfully,beautifully,bitterly,bleakly,blindly,blissfully,boastfully,boldly,bravely,briefly,brightly,briskly,broadly,busily,calmly,carefully,carelessly,cautiously,certainly,cheerfully,clearly,cleverly,closely,coaxingly,colorfully,commonly,continually,coolly,correctly,courageously,crossly,cruelly,curiously,daily,daintily,dearly,deceivingly,delightfully,deeply,defiantly,deliberately,delightfully,diligently,dimly,doubtfully,dreamily,easily,elegantly,energetically,enormously,enthusiastically,equally,especially,even,evenly,eventually,exactly,excitedly,extremely,fairly,faithfully,famously,far,fast,fatally,ferociously,fervently,fiercely,fondly,foolishly,fortunately,frankly,frantically,freely,frenetically,frightfully,fully,furiously,generally,generously,gently,gladly,gleefully,gracefully,gratefully,greatly,greedily,happily,hastily,healthily,heavily,helpfully,helplessly,highly,honestly,hopelessly,hourly,hungrily,immediately,innocently,inquisitively,instantly,intensely,intently,interestingly,inwardly,irritably,jaggedly,jealously,joshingly,joyfully,joyously,jovially,jubilantly,judgementally,justly,keenly,kiddingly,kindheartedly,kindly,kissingly,knavishly,knottily,knowingly,knowledgeably,kookily,lazily,less,lightly,likely,limply,lively,loftily,longingly,loosely,lovingly,loudly,loyally,madly,majestically,meaningfully,mechanically,merrily,miserably,mockingly,monthly,more,mortally,mostly,mysteriously,naturally,nearly,neatly,needily,nervously,never,nicely,noisily,not,obediently,obnoxiously,oddly,offensively,officially,often,only,openly,optimistically,overconfidently,owlishly,painfully,partially,patiently,perfectly,physically,playfully,politely,poorly,positively,potentially,powerfully,promptly,properly,punctually,quaintly,quarrelsomely,queasily,queerly,questionably,questioningly,quicker,quickly,quietly,quirkily,quizzically,rapidly,rarely,readily,really,reassuringly,recklessly,regularly,reluctantly,repeatedly,reproachfully,restfully,righteously,rightfully,rigidly,roughly,rudely,sadly,safely,scarcely,scarily,searchingly,sedately,seemingly,seldom,selfishly,separately,seriously,shakily,sharply,sheepishly,shrilly,shyly,silently,sleepily,slowly,smoothly,softly,solemnly,solidly,sometimes,soon,speedily,stealthily,sternly,strictly,successfully,suddenly,surprisingly,suspiciously,sweetly,swiftly,sympathetically,tenderly,tensely,terribly,thankfully,thoroughly,thoughtfully,tightly,tomorrow,too,tremendously,triumphantly,truly,truthfully,ultimately,unabashedly,unaccountably,unbearably,unethically,unexpectedly,unfortunately,unimpressively,unnaturally,unnecessarily,utterly,upbeat,upliftingly,upright,upward,upwardly,urgently,usefully,uselessly,usually,utterly,vacantly,vaguely,vainly,valiantly,vastly,verbally,very,viciously,victoriously,violently,vivaciously,voluntarily,warmly,weakly,wearily,well,wetly,wholly,wildly,willfully,wisely,woefully,wonderfully,worriedly,wrongly,yawningly,yearly,yearningly,yesterday,yieldingly,youthfully,zealously,zestfully,zestily,";
                        string word = null;
                        for (int i = 0; i < filecontent.Length; i++)
                        {
                            if (filecontent[i] == ',')
                            {
                                allword.Add(word);
                                word = null;
                            }
                            else
                            {
                                word += filecontent[i];
                            }
    
    
                        }
                        Random r = new Random();
                        int rd = r.Next(0, allword.Count);
                        cword = allword[rd];
                        puzzleWord.Add(new CurrentWord() { wordContent = cword });
                        puzzleWord.TrimExcess();
                        llstdata.ItemsSource = puzzleWord;
                        // code to read wordi file from isolated storge explorer
                    }
               // }
                catch (Exception)
                {
                    
                    throw;
                }
                
    
            }
    
            private void btngo_Click(object sender, RoutedEventArgs e)
            {
              //MessageBox.Show(allword.Count.ToString());
              string userinput=  txtinput.Text;
              if (userinput[0] != cword[cword.Length - 1])
              {
                  return;
              }
              puzzleWord.Add(new CurrentWord() { wordContent = userinput });
            //  puzzleWord.TrimExcess();
              cword = userinput;
              char lastchar = cword[cword.Length - 1];
              List<string> startwithuserchar = new System.Collections.Generic.List<string>();
              foreach (var item in allword)
              {
                  if (item.StartsWith(lastchar.ToString()))
                  {
                      startwithuserchar.Add(item);
                  }
                  
                  
              }
              Random r = new Random();
              int rd = r.Next(0, startwithuserchar.Count);
              cword = startwithuserchar[rd];
                puzzleWord.Add(new CurrentWord(){wordContent=cword});
                puzzleWord.TrimExcess();
                llstdata.ItemsSource=puzzleWord;
            }
    }
    }

    To display the word entered by the user and the computer i am using the longlist selector element

    Now for the first time computer displays the word properly and immediately after I am getting the

    following exception

    An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in System.Windows.ni.dll

    I have no idea where thing is getting wrong.

    As per knowledge we get this error when we are trying to access something that not exist or available.

    Any help will be appericited

    Thanx in advance


    2013年7月9日 13:01

全部回复