eGospodarka.pl
eGospodarka.pl poleca

eGospodarka.plFinanseGrupypl.biznes.bankiPomocy › Re: Pomocy
  • Path: news-archive.icm.edu.pl!newsfeed.gazeta.pl!opal.futuro.pl!newsfeed.tpinternet.p
    l!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
    From: Remigiusz Babicz <r...@p...onet.pl>
    Newsgroups: pl.biznes.banki
    Subject: Re: Pomocy
    Date: Thu, 03 Mar 2005 13:56:05 +0100
    Organization: tp.internet - http://www.tpi.pl/
    Lines: 36
    Message-ID: <d071oj$rfp$1@nemesis.news.tpi.pl>
    References: <d070nb$5a0$1@news.onet.pl>
    NNTP-Posting-Host: rasco4.raster.krakow.pl
    Mime-Version: 1.0
    Content-Type: text/plain; charset=ISO-8859-2; format=flowed
    Content-Transfer-Encoding: 8bit
    X-Trace: nemesis.news.tpi.pl 1109854803 28153 212.160.153.156 (3 Mar 2005 13:00:03
    GMT)
    X-Complaints-To: u...@t...pl
    NNTP-Posting-Date: Thu, 3 Mar 2005 13:00:03 +0000 (UTC)
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b) Gecko/20050217
    In-Reply-To: <d070nb$5a0$1@news.onet.pl>
    Xref: news-archive.icm.edu.pl pl.biznes.banki:338979
    [ ukryj nagłówki ]

    onet wrote:
    > Moze ktoś wie jak wygenerować poprawny numer bankowy ???
    > Jak obliczyć liczbę kontrolną ??

    Poniżej masz kod funkcji w C# - możesz przerobić.
    Nie są zbyt piękne, ale działają.

    reik

    public static bool CheckIBANPL(string a_strValue)
    {
    try
    {
    if(a_strValue.Length == 28)
    {
    a_strValue =
    (a_strValue.Substring(4)+a_strValue.Substring(0,4)).
    Replace("PL","2521");
    long a = Int64.Parse(a_strValue.Substring(0,15));
    long rest = (a % 97)*1000000000000000 +
    Int64.Parse(a_strValue.Substring(15));
    if(rest % 97 == 1)
    {
    return true;
    }
    }
    }
    catch (Exception)
    { }
    return false;
    }
    public static bool CheckNRB(string a_strValue)
    {
    string strCheck = a_strValue.Replace ("-", "");
    strCheck = strCheck.Replace (" ", "");
    return CheckIBANPL ("PL" + strCheck);
    }

Podziel się

Poleć ten post znajomemu poleć

Wydrukuj ten post drukuj


Następne wpisy z tego wątku

Najnowsze wątki z tej grupy


Najnowsze wątki

Szukaj w grupach

Eksperci egospodarka.pl

1 1 1