Pogledajte određenu poruku
Staro 27. 01. 2016.   #1
slavkan
profesionalac
Professional
 
Datum učlanjenja: 30.08.2010
Poruke: 201
Hvala: 10
640 "Hvala" u 14 poruka
slavkan is on a distinguished roadslavkan is on a distinguished roadslavkan is on a distinguished roadslavkan is on a distinguished roadslavkan is on a distinguished roadslavkan is on a distinguished road
Default Source array was not long enough

Pozdrav svima.
Imam exception na metodu ispod.
Sta sa nizom nije dovoljno "long"?

Evo print-screen exception-a:
http://picpaste.com/Screenshot_7-dFA8Vq9P.png
Hvala unapred.


Kôd:
public static CryptoStream GetCryptoReadStream( Stream stream ) 
    {
        ICryptoTransform encryptor;
        Byte[] byteName;
        Byte[] byteSerial;

        byteName=new Byte[32];
        byteName.Initialize();

        byteSerial=new Byte[16];
        byteSerial.Initialize();

        Array.Copy(Encoding.ASCII.GetBytes(Settings.Name),0,byteName,0,
        Math.Min(Encoding.ASCII.GetBytes(Settings.Name).Length,32));
               Array.Copy(Encoding.ASCII.GetBytes(Settings.Serial),0,byteSerial,0,16);

        RijndaelManaged rm;
        rm=new RijndaelManaged();

        encryptor=rm.CreateDecryptor(byteName,byteSerial);

        CryptoStream cryptoStream;
        cryptoStream=new CryptoStream(stream,encryptor,CryptoStreamMode.Read);

        return cryptoStream;
    }
slavkan je offline   Odgovorite uz citat
135 članova zahvaljuje slavkan za poruku:
aatavaolens, acheapnew, achelmeyerneilk, aczapiewskshain, aeprocaccnath, aionscalzconc, allen4jim, alovermannmiche, aoncadarr, ardgraafwilfo, areraodel, arinalva, aringascarl, aschoonovemaked, atadh, atyraanis, bapplebattery, bilpboyc, brdvenablerayfo, calmoncenath, campanellawiley, cellocchiwino, cfakecoach, cheapestcheapes, cmmecare, cstorecanada, ctarrickdied, cteciuccihenr, dgendant, dokedziersrosen, dswhiddendema, eabuechersophi, eambleclai, eangeruth, ebeisermarq, ecoervergabr, econeclar, edressesgreen, ejerseynfl, emathiesokenn, emcqueenanto, emergelhous, encasteranto, enereebthom, enhaldermjona, enpaynetruma, epromdesigns, ershauerbric, esalenike, esbardneymarku, esbissonetulyss, etolefreemiles, fhrentfrokhad, hlaschalbe, hlsetheldo, hschherb, iaidimarc, ichristianheels, idvddisney, inmonningequent, ionpanfilprest, iyuriciclave, jnayjaso, jsenajelia, kdlakrick, khackduan, ksaajokuthere, larholburt, lclachlandust, ldiellobryo, ldoduchschreyna, lemosellerobbi, lerolees, lriedldonn, metwmper, nbrabantarma, ncarpinonumb, nenningmick, nesimankricki, neveningparty, nielbarrinnatha, nincenorah, nnaellanknatha, nnvalentasun, nramanyjule, ntasklandruper, nteilingayan, ntoscanoraym, nydencesa, ocintoyongs, oegwoodsydn, ofashionwigs, oiezarconepearl, oitchmorerowe, okristoffflor, olmilhoanhers, ottleroehugo, pcheapface, pdekenipproger, prdpala, racmurraylize, racovaratimi, rahrexv, raynormarl, rdheminovemayna, renmorebufo, rlamryan, rlingeriebuy, ronicodemumilag, rransbrowerne, rumbersjoey, rverydresses, rwaversteve, rwoyerleon, rymyerkrai, sarosmarl, sdressesdresses, selmasnico, semerssonn, shelmsdarr, skocsismoshe, snbilkissmarli, sowsamd, srdbaisesanfo, stensmaik, tarnetcalv, teastali, tewittgran, tezabielskyevet, traditionaltrad, twaratmarc, uungblutsonyo, waskiewichowa, wholesaleprices, yatelybret