Article View: chile.comp.programacion
Article #2510Re: Validar RUT en vb.net
From: gato2005_cl
Date: Sat, 03 Dec 2005 04:28
Date: Sat, 03 Dec 2005 04:28
36 lines
1858 bytes
1858 bytes
VB 6
Function valrut(rut As String)
Dim largo, mult, suma, dv As Integer
Dim dvstr As String
largo = Len(Trim(rut))
suma = 0
mult = 2
For j = largo To 1 Step -1
If mult = 8 Then mult = 2
suma = suma + Val(Mid(rut, j, 1)) * mult
mult = mult + 1
Next j
resto = suma Mod 11
dv = 11 - resto
If dv = 11 Then dvstr = 0
If dv = 10 Then dvstr = "K"
If dv <> 11 And dv <> 10 Then dvstr = Str(dv)
valrut = dvstr
End Function
RobertoCL escribi�:
> Alguien tendr� entre sus cachureos la clase, o el modulo o la funci�n para
> validar el RUT, en visual basic .net para que la postee por favor. Supongo
> que la funci�n en vb6 sirve, la tenia pero se me perdi�.
>
> --
> RCL
>
>
>
Technical Details
Message-ID:
<dmoiil$7kc$1@news.nivel5.cl>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!news-xfer.nntp.sonic.net!news.kjsl.com!news.nivel5.cl!not-for-mailReferences:
<dmoh5p$6q0$1@news.nivel5.cl>Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,1bbc6fb810afa28 X-Google-Attributes: gid1593cb,public X-Google-Language: SPANISH,CP1252 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!news-xfer.nntp.sonic.net!news.kjsl.com!news.nivel5.cl!not-for-mail From: gato2005_cl <gato2005_clSINESTO@spymac.com> Newsgroups: chile.comp.programacion Subject: Re: Validar RUT en vb.net Date: Sat, 03 Dec 2005 01:28:48 -0300 Organization: Varios Lines: 36 Message-ID: <dmoiil$7kc$1@news.nivel5.cl> References: <dmoh5p$6q0$1@news.nivel5.cl> NNTP-Posting-Host: pc-178-51-86-200.cm.vtr.net Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.nivel5.cl 1133497749 7820 200.86.51.178 (2 Dec 2005 04:29:09 GMT) X-Complaints-To: news@news.nivel5.cl NNTP-Posting-Date: Fri, 2 Dec 2005 04:29:09 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Win98; es-ES; rv:1.7.10) Gecko/20050716 Thunderbird/1.0.7 Mnenhy/0.7.2.0 X-Accept-Language: es-es, es In-Reply-To: <dmoh5p$6q0$1@news.nivel5.cl>