编程语言

img iwebsms

称骨算命的VB.NET类

发表于2004/9/28 19:22:00  2795人阅读

Public Class ClassChG

    Private vWeight As Integer = 0

    Private vResultWord As String

 

    'vDate格式为:1978-8-10

    'vTime值为:

    '子:子(23:00~1:00)

    '丑:丑(1:00~3:00)

    '寅:寅(3:00~5:00)

    '卯:卯(5:00~7:00)

    '辰:辰(7:00~9:00)

    '巳:巳(9:00~11:00)

    '午:午(11:00~13:00)

    '未:未(13:00~15:00)

    '申:申(15:00~17:00)

    '酉:酉(17:00~19:00)

    '戌:戌(19:00~21:00)

    '亥:亥(21:00~23:00)

    Public Sub New(ByVal vDate As String, ByVal vTime As String)

        Dim ss() As String = Split(vDate, "-")

        vWeight += Me.GetYearValue(ss(0))

        vWeight += Me.GetMonthValue(ss(1))

        vWeight += Me.GetDayValue(ss(2))

        vWeight += Me.GetTimeValue(vTime)

 

        vResultWord = Me.GetResultWord(vWeight)

    End Sub

 

    Public ReadOnly Property Weight() As Integer

        Get

            Weight = vWeight

        End Get

    End Property

 

    Public ReadOnly Property ResultWord() As String

        Get

            ResultWord = vResultWord

        End Get

    End Property

 

    Function GetYearValue(ByVal Year As Integer) As Integer

        Select Case Year

            Case 1900 : Return 7

            Case 1901 : Return 7

            Case 1902 : Return 9

            Case 1903 : Return 12

            Case 1904 : Return 8

            Case 1905 : Return 7

            Case 1906 : Return 13

            Case 1907 : Return 5

            Case 1908 : Return 14

            Case 1909 : Return 5

 

            Case 1910 : Return 9

            Case 1911 : Return 17

            Case 1912 : Return 5

            Case 1913 : Return 7

            Case 1914 : Return 12

            Case 1915 : Return 8

            Case 1916 : Return 5

            Case 1917 : Return 6

            Case 1918 : Return 19

            Case 1919 : Return 6

 

            Case 1920 : Return 8

            Case 1921 : Return 16

            Case 1922 : Return 10

            Case 1923 : Return 7

            Case 1924 : Return 12

            Case 1925 : Return 9

            Case 1926 : Return 6

            Case 1927 : Return 7

            Case 1928 : Return 12

            Case 1929 : Return 5

 

            Case 1930 : Return 9

            Case 1931 : Return 8

            Case 1932 : Return 7

            Case 1933 : Return 8

            Case 1934 : Return 15

            Case 1935 : Return 9

            Case 1936 : Return 16

            Case 1937 : Return 8

            Case 1938 : Return 8

            Case 1939 : Return 9

 

            Case 1940 : Return 12

            Case 1941 : Return 6

            Case 1942 : Return 8

            Case 1943 : Return 5

            Case 1944 : Return 5

            Case 1945 : Return 15

            Case 1946 : Return 6

            Case 1947 : Return 16

            Case 1948 : Return 15

            Case 1949 : Return 8

 

            Case 1950 : Return 9

            Case 1951 : Return 12

            Case 1952 : Return 10

            Case 1953 : Return 7

            Case 1954 : Return 15

            Case 1955 : Return 6

            Case 1956 : Return 5

            Case 1957 : Return 14

            Case 1958 : Return 14

            Case 1959 : Return 9

 

            Case 1960 : Return 7

            Case 1961 : Return 7

            Case 1962 : Return 9

            Case 1963 : Return 12

            Case 1964 : Return 8

            Case 1965 : Return 7

            Case 1966 : Return 13

            Case 1967 : Return 5

            Case 1968 : Return 14

            Case 1969 : Return 5

 

            Case 1970 : Return 9

            Case 1971 : Return 17

            Case 1972 : Return 5

            Case 1973 : Return 7

            Case 1974 : Return 12

            Case 1975 : Return 8

            Case 1976 : Return 5

            Case 1977 : Return 6

            Case 1978 : Return 19

            Case 1979 : Return 6

 

            Case 1980 : Return 8

            Case 1981 : Return 16

            Case 1982 : Return 10

            Case 1983 : Return 7

            Case 1984 : Return 12

            Case 1985 : Return 9

            Case 1986 : Return 6

            Case 1987 : Return 7

            Case 1988 : Return 12

            Case 1989 : Return 5

 

            Case 1990 : Return 9

            Case 1991 : Return 8

            Case 1992 : Return 7

            Case 1993 : Return 8

            Case 1994 : Return 15

            Case 1995 : Return 9

            Case 1996 : Return 16

            Case 1997 : Return 8

            Case 1998 : Return 8

            Case 1999 : Return 9

 

            Case 2000 : Return 12

            Case 2001 : Return 6

            Case 2002 : Return 8

            Case 2003 : Return 5

            Case 2004 : Return 5

            Case 2005 : Return 15

            Case 2006 : Return 6

            Case 2007 : Return 16

            Case 2008 : Return 15

            Case 2009 : Return 8

 

            Case 2010 : Return 9

            Case 2011 : Return 12

            Case Else : Throw New NotSupportedException("本函数只提供1900年至2011年的时间转换!")

        End Select

    End Function

    Function GetMonthValue(ByVal Month As Integer) As Integer

        Select Case Month

            Case 1 : Return 6

            Case 2 : Return 7

            Case 3 : Return 18

            Case 4 : Return 5

            Case 5 : Return 9

            Case 6 : Return 16

            Case 7 : Return 9

            Case 8 : Return 15

            Case 9 : Return 18

            Case 10 : Return 8

            Case 11 : Return 9

            Case 12 : Return 5

        End Select

    End Function

    Function GetDayValue(ByVal Day As Integer) As Integer

        Select Case Day

            Case 1 : Return 5

            Case 2 : Return 10

            Case 3 : Return 8

            Case 4 : Return 15

            Case 5 : Return 16

            Case 6 : Return 15

            Case 7 : Return 8

            Case 8 : Return 16

            Case 9 : Return 8

 

            Case 10 : Return 16

            Case 11 : Return 9

            Case 12 : Return 17

            Case 13 : Return 8

            Case 14 : Return 17

            Case 15 : Return 10

            Case 16 : Return 8

            Case 17 : Return 9

            Case 18 : Return 18

            Case 19 : Return 5

 

            Case 20 : Return 15

            Case 21 : Return 10

            Case 22 : Return 9

            Case 23 : Return 8

            Case 24 : Return 9

            Case 25 : Return 15

            Case 26 : Return 17

            Case 27 : Return 7

            Case 28 : Return 8

            Case 29 : Return 16

            Case 30 : Return 6

        End Select

    End Function

    Function GetTimeValue(ByVal Time As String) As Integer

        Select Case Time

            Case "子" : Return 16

            Case "丑" : Return 6

            Case "寅" : Return 7

            Case "卯" : Return 10

            Case "辰" : Return 9

            Case "巳" : Return 16

            Case "午" : Return 10

            Case "未" : Return 8

            Case "申" : Return 8

            Case "酉" : Return 9

            Case "戌" : Return 6

            Case "亥" : Return 6

        End Select

    End Function

    Function GetResultWord(ByVal Value As Integer) As String

        Select Case Value

            Case 22

                Return "身寒骨冷苦伶仃,此命推来行乞人,碌碌巴巴无度日,终年打拱过平生。"

            Case 23

                Return "此命推来骨自轻,求谋作事事难成,妻儿兄弟应难许,别处他乡作散人。"

            Case 24

                Return "此命推来福禄无,门庭困苦总难营,六亲骨肉皆无靠,流到他乡作老翁。"

            Case 25

                Return "此命推来祖业微,门庭营度似稀奇,六亲骨肉如冰炭,一世难劳自把持。"

            Case 26

                Return "平生衣禄苦中求,独自经营事不休,离祖出门宜早计,晚来衣禄庶无忧。"

            Case 27

                Return "一生作事少商量,难靠祖宗作主张,独马单枪空做去,早年晚岁总无长。"

            Case 28

                Return "一生行事似飘蓬,祖宗产业大梦中,若不过房并改姓,也当移徙二三通。"

            Case 29

                Return "初年运限未曾亨,纵有功名在后成,须过四旬才可上,移居改姓始为良。"

            Case 30

                Return "劳劳碌碌苦中求,东走西奔何日休,苦使终身勤与俭,老来稍可免忧愁。"

            Case 31

                Return "忙忙碌碌苦中求,何日云开见日头,难得祖基家可立,中年衣食渐能周。"

            Case 32

                Return "初年支蹇事难谋,渐有财源如水流,到得中年衣食旺,那时名利一起来。"

            Case 33

                Return "早年作事事难成,百计徒劳枉费心,半世自如流水去,后来运到得黄金。"

            Case 34

                Return "此命福气果如何,僧道门中衣禄多,离祖出家方得妙,终朝拜佛念弥陀。"

            Case 35

                Return "生平福星不周全,祖业根基觉不传,营事生涯宜守旧,时来衣食胜从前。"

            Case 36

                Return "不须劳碌过平生,独自成家福不轻,早有福星常照命,任君行去百般成。"

            Case 37

                Return "此命般般事不成,弟兄少力自孤成,虽然祖业须微有,来得明时去不明。"

            Case 38

                Return "一身骨肉最清高,早入学门姓名标,待看年将三十六,蓝衫脱去换红袍。"

            Case 39

                Return "此命终身运不通,劳劳作事尽皆空,苦心竭力成家计,到得那时在梦中。"

            Case 40

                Return "平生衣禄是绵长,件件心中自主张,前面风霜多受过,后来必定亨安康。"

            Case 41

                Return "此命推来事不同,为人能干异凡庸,中年还有逍遥福,不比前年运未福。"

            Case 42

                Return "得宽怀处且宽怀,何用双眉皱不开,若使中年命运济,那时名利一齐来。"

            Case 43

                Return "为人心性最聪明,作事轩昂近贵人,衣禄一身天数定,不须劳碌是丰亨。"

            Case 44

                Return "来事由天苦相求,须知福禄胜前途,当年财帛难如意,晚景忻然使不忧。"

            Case 45

                Return "名利推来竟若何,前途辛苦后奔波,命中难养男与女,骨肉扶持也不多。"

            Case 46

                Return "东西南北尽皆通,出姓移居更觉隆,衣禄无亏天数定,中年晚景一般同。"

            Case 47

                Return "此命推为旺末年,妻荣子贵自怡然,平生原有滔滔福,可有财源如水流。"

            Case 48

                Return "初年运道未曾亨,若是蹉跎再不兴,兄弟六亲皆无靠,一身事业晚年成。"

            Case 49

                Return "此命推来福不轻,自成自立显门庭,从来富贵人钦敬,使婢差奴过一生。"

            Case 50

                Return "为利为名终日劳,中年福禄也多遭,老来是有财星照,不比前番目下高。"

            Case 51

                Return "一世荣华事事通,不须劳碌自亨通,弟兄叔侄皆如意,家业成时福禄宏。"

            Case 52

                Return "一世荣华事事能,不须劳思自然宁,宗族欣然心皆好,家业丰亨自称心。"

            Case 53

                Return "此格推为气量真,兴家发达在其中,一生福禄安排定,却是人间一富翁。"

            Case 54

                Return "此命推来厚且清,诗书满腹看功成,丰衣足食自然稳,正是人间有福人。"

            Case 55

                Return "走马扬鞭争名利,少年作事费筹论,一朝福禄源源至,富贵荣华显六亲。"

            Case 56

                Return "此格扒来礼义通,一身福禄用无穷,甜酸苦辣皆当过,滚滚财源稳且丰。"

            Case 57

                Return "福禄丰盈万事全,一身荣耀显双亲,名扬威振人钦敬,处世逍遥似遇春。"

            Case 58

                Return "平生福禄自然来,名利兼全福寿偕,雁塔题名为贵客,紫袍金带走金阶。"

            Case 59

                Return "细推此格妙且清,必定才高礼义通,甲第之中应有分,扬鞭走马显威荣。"

            Case 60

                Return "一朝金榜快题名,显祖荣宗立大功,衣禄定然原裕足,田园财帛更丰盈。"

            Case 61

                Return "不作朝中金榜客,定为世上一财翁,聪明天赋经书熟,名显高科自是荣。"

            Case 62

                Return "此命生来福不穷,读书必定显亲宗,紫衣金带为卿相,富贵荣华皆可同。"

            Case 63

                Return "命主为官福禄长,得来富贵实非常,名题金塔传金榜,定中高科天下场。"

            Case 64

                Return "此格威权不可当,紫袍金带坐高堂,荣华富贵谁能及,积玉堆金满储仓。"

            Case 65

                Return "细推此命福不轻,定国安邦极品人,文绣雕梁徵富贵,威声照耀四方闻。"

            Case 66

                Return "此格人间一福人,堆金积丽满堂春,从来富贵由天定,正笏垂绅谒圣君。"

            Case 67

                Return "此命生来福自宏,田园家业最高隆,平生衣禄盈丰足,一世荣华万事通。"

            Case 68

                Return "富贵由天莫苦求,万金家计不须谋,十年不此前番事,祖业根基水上舟。"

            Case 69

                Return "君是人间衣禄星,一生富贵众人钦,纵然福禄由天定,安享荣华过一生。"

            Case 70

                Return "此命推来福不轻,不须愁虑苦劳心,一生天定衣与禄,富贵荣华主一身。"

            Case 71

                Return "此命生来大不同,公侯卿相在其中,一生自有逍遥福,富贵荣华极品隆。"

            Case Else

                Throw New NotSupportedException("不存在的骨重!")

        End Select

    End Function

End Class

阅读全文
0 0

相关文章推荐

img
取 消
img