Pogledajte određenu poruku
Staro 27. 01. 2016.   #1
slavkan
profesionalac
Professional
 
Datum učlanjenja: 30.08.2010
Poruke: 200
Hvala: 10
440 "Hvala" u 13 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 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
80 članova zahvaljuje slavkan za poruku:
aatavaolens, acheapnew, achelmeyerneilk, aeprocaccnath, allen4jim, alovermannmiche, anorthfacemens, areraodel, arinalva, aringascarl, aschoonovemaked, atadh, bapplebattery, bilpboyc, calmoncenath, cellocchiwino, ceszucheldr, cfakecoach, cstorecanada, cteciuccihenr, dorflesnersalva, dswhiddendema, eambleclai, eangeruth, ebeisermarq, eclawgesrayf, ecoervergabr, econeclar, edressesgreen, emcqueenanto, encasteranto, ershauerbric, esalenike, esbardneymarku, fhrentfrokhad, haughbobb, hlaschalbe, hneprchalvale, hschherb, iaidimarc, ichristianheels, idvddisney, ihybhatiatimot, kdlakrick, ksaajokuthere, ldoduchschreyna, lriedldonn, mjanemiles, neveningparty, ngreenbackmarti, nincenorah, nramanyjule, ntasklandruper, ofashionwigs, oiezarconepearl, oitchmorerowe, okristoffflor, osjoem, ottleroehugo, pcheapface, prdpala, racmurraylize, renmorebufo, rheldermajuli, rlamryan, rlaverestep, rlingeriebuy, rochnersungb, rumbersjoey, rymyerkrai, skocsismoshe, stensmaik, tarnetcalv, teastali, tezabielskyevet, ueesaunanni, uungblutsonyo, waskiewichowa, wholesalephones, yrleyange