| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 835 人关注过本帖
标题:方法和数据成员未找到 错误461 要怎么解决啊
只看楼主 加入收藏
ludaolian
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-3-7
收藏
 问题点数:0 回复次数:0 
方法和数据成员未找到 错误461 要怎么解决啊
Private Sub Timer3_Timer()

Select Case [un]Winsock1.State[/un]
Case 0: s = "服务器关闭"

Case 1: s = "打开套接字"

Case 2: s = "正监听端口"

Case 3: s = "正在进行未定的连接"

Case 4: s = "正解析主机地址"

Case 5: s = "主机地址已解析 """

Case 6: s = "正在连接"

Case 7: s = "已连接"

Case 8: s = "连接关闭"

Case 9: s = "错误"
End Select


Label8.Caption = s
End Sub

Private Sub Timer4_Timer()
Static tag1 As Integer
If mengyan = True Then
meng.Visible = True
tag1 = tag1 + 1
If tag1 > 20 Then mengyan = False: tag1 = 0: meng.Visible = False
End If

End Sub

Private Sub Timer5_Timer()
Static tag1 As Integer
If jinshou = True Then

j1.Visible = True
j2.Visible = True
j3.Visible = True
kaishi = False
Timer1.Enabled = False

tag1 = tag1 + 1
j3.Caption = str(11 - tag1)

If tag1 > 10 Then jinshou = False: tag1 = 0: j1.Visible = False: j2.Visible = False: j3.Visible = False: kaishi = True: Timer1.Enabled = True
End If

End Sub

Private Sub Timer6_Timer()
Static tag1 As Integer
If naozhong = True Then
Timer1.Interval = 50
tag1 = tag1 + 1
If tag1 > 10 Then naozhong = False: tag1 = 0: Timer1.Interval = 500
End If


End Sub

Private Sub ts_Click()
'提示菜单
If tishics > 0 And kaishi = True Then
   If tishi(0) = False Then

                              '没有能连的了
                 If cpcishu > 0 Then
                 If winsumold > 4 Then cpcishu = cpcishu - 1: Call chongpaisub: MsgBox winsumold
                    Label6.Caption = str(cpcishu)
                    
                 Else
                    MsgBox "GAME OVER"
                  kaishi = False
                  Timer1.Enabled = False
                 End If
               
   'MsgBox "没有能连的了"
   
   GoTo endts:
   
   End If
   
   tishics = tishics - 1
   wm.URL = "sound\hint.wav"
   Label2.Caption = str(tishics)
End If
endts:

End Sub



Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If Winsock1.State <> sckClosed Then Winsock1.Close

Winsock1.Accept requestID '在监听的端口有连接请求发生时,立即调用Accept方法

'认可连接,使之生效。


MsgBox "有用户联上了"
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim strdata As String
Winsock1.GetData strdata, vbString  '当有数据到达时,调用GetData方法接收之
If strdata = "mengyan" Then mengyan = True
If strdata = "duidiao" Then Call diandao
If strdata = "jinshou" Then jinshou = True
If strdata = "naozhong" Then naozhong = True

If strdata = "w" Then kaishi = False: Timer1.Enabled = False: MsgBox "you lose"
If strdata = "lose" Then kaishi = False: Timer1.Enabled = False: MsgBox "you win": winsum = 0
df.Caption = Trim(Val(strdata))
'Text1.Text = strData
End Sub

Private Sub Winsock2_Connect()
MsgBox "connected to server!"
woshikehu = True
ga.Enabled = False
End Sub

Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
Dim str, s As String
Dim k, ka As Integer
Dim strdata As String
Dim son As Integer

Dim kong As Integer

son = Int(Rnd(1) * 9 + 1)
'For i = 0 To 10
   ' For j = 0 To ly
  '  Winsock2.GetData str, vbString
  '      map(i, j) = Val(str)
   '     Image1(tok(i, j)).Picture = LoadPicture("tb\" + Trim(str) + ".jpg")
  '  Next j
'Next i
Winsock2.GetData str, vbString
'MsgBox str
If str = "mengyan" Then mengyan = True
If str = "duidiao" Then Call diandao
If str = "jinshou" Then jinshou = True
If str = "naozhong" Then naozhong = True
If str = "lose" Then
kaishi = False
Timer1.Enabled = False
MsgBox "you win"
winsum = 0
sta = False
For ka = 0 To 208
emap(tosx(ka), tosy(ka)) = 0
map(tosx(ka), tosy(ka)) = 0
Image1(ka).Picture = LoadPicture("")
Next ka
GoTo endla:
End If

If str = "w" Then
kaishi = False
Timer1.Enabled = False
MsgBox "you lose"
sta = False
For ka = 0 To 208
emap(tosx(ka), tosy(ka)) = 0
map(tosx(ka), tosy(ka)) = 0
Image1(ka).Picture = LoadPicture("")
Next ka
winsum = 0
GoTo endla:

End If

If sta = False Then



s = ""
k = 1
aa22:
Do While Mid(str, k, 1) <> ","
s = s + Mid(str, k, 1)
k = k + 1
Loop

map(tosx(kong), tosy(kong)) = Val(Trim(s))
If Val(Trim(s)) > 0 Then winsum = winsum + 1
If Trim(s) <> 0 Then Image1(kong).Picture = LoadPicture("tb\" + Trim(s) + ".jpg")
'MsgBox Trim(s)
s = ""
k = k + 1
kong = kong + 1
If kong > 208 Then GoTo endl:

GoTo aa22:


endl:

sta = True
kaishi = True

Shape1.Width = 9855
Timer1.Enabled = True
editmapk = False '关掉地图编辑模式
loadeditmap.Enabled = False '自编地图无效
fenshu = 0  '分数清零
cpcishu = 0   '重排次数为0
tishics = 0  '设定提示次数

zanting.Enabled = False      '暂停,提示设为可用
ts.Enabled = True
chongpai = True  '重排可用
zibian = False  '关闭自编模式
savemap = False '保存地图无效
'wmbg.URL = "sound\" + Trim(str(son)) + ".mp3"

Else

'Winsock2.GetData strdata, vbString  '当有数据到达时,调用GetData方法接收之
df.Caption = Trim(Val(str))
End If

endla:

End Sub

Private Sub zanting_Click()
'暂停菜单
If zanting.Caption = "暂停" Then
     kaishi = False
     Timer1.Enabled = False
     For i = 0 To 208
       Image1(i).Visible = False
       Next i
      
       zanting.Caption = "开始"
                         Shape_a.Visible = False
                  Shape_b.Visible = False
       Else
       kaishi = True
       Timer1.Enabled = True
          For i = 0 To 208
       Image1(i).Visible = True
       Next i
       zanting.Caption = "暂停"

      
       End If
      
End Sub

Private Sub chongpaisub()
'重排功能做好啦~~~~哈哈哈~~
Dim temp(208) As Integer
Dim qtemp As Integer
Dim i, zsum, j, k As Integer

zsum = 0

For i = 0 To 10
   For j = 0 To ly
      If map(i, j) > 0 Then zsum = zsum + 1: temp(zsum) = map(i, j)
    Next j
Next i

For i = 1 To zsum
s = s + " " + str(temp(i))
Next i

For i = 0 To 10     '给地图赋初值为0  ,也就是空
  For j = 0 To ly
    If map(i, j) > 0 Then      'Image1(tok(i, j)).Picture = LoadPicture("tb\1.jpg"): esum = esum + 1
      Randomize (Timer)
      qtemp = Int(Rnd(1) * zsum + 1)
      map(i, j) = temp(qtemp)
     
      Image1(tok(i, j)).Picture = LoadPicture("tb\" + Trim(str(temp(qtemp))) + ".jpg")
      For k = qtemp To zsum
       temp(k) = temp(k + 1)

       Next k
      
       zsum = zsum - 1
       End If
      
  Next j
Next i
End Sub

Private Sub leibie(lei As Integer)
If lei = 1 Then tishics = tishics + 1: Label2.Caption = str(tishics)
If lei = 2 Then cpcishu = cpcishu + 1: Label6.Caption = str(cpcishu)
If lei = 6 Then mengyansum = mengyansum + 1: Label12.Caption = str(mengyansum)
If lei = 7 Then duidiaosum = duidiaosum + 1: Label14.Caption = str(duidiaosum)
If lei = 5 Then zhadansum = zhadansum + 1: Label16.Caption = str(zhadansum)
If lei = 3 Then jinshousum = jinshousum + 1: Label18.Caption = str(jinshousum)
If lei = 4 Then naozhongsum = naozhongsum + 1: Label20.Caption = str(naozhongsum)



End Sub


Sub xslink(ByVal ax As Integer, ByVal ay As Integer, ByVal bx As Integer, ByVal by As Integer, zt As Integer)
'显示两点之间的连线
'zt = 0 画线
'zt = 1 擦线
Dim i As Integer
Dim tes1, tes2 As String
If zt = 0 Then tes1 = "tb\hx.gif": tes2 = "tb\sx.gif"
If zt = 1 Then tes1 = "": tes2 = ""

If ax = bx Or ay = by Then

If Abs(ax - bx) + Abs(ay - by) <= 1 Then

GoTo endaa:
Else

  If ax = bx Then
     If ay < by Then
       For i = ay + 1 To by - 1
         Image1(tok(ax, i)).Picture = LoadPicture(tes1)
       Next i
     End If
     
     If ay > by Then
       For i = by + 1 To ay - 1
         Image1(tok(ax, i)).Picture = LoadPicture(tes1)
       Next i
     End If
   
  End If
  
  If ay = by Then
     If ax < bx Then
       For i = ax + 1 To bx - 1
         
         Image1(tok(i, ay)).Picture = LoadPicture(tes2)
       Next i
     End If
     
     If ax > bx Then
       For i = bx + 1 To ax - 1
        
         Image1(tok(i, ay)).Picture = LoadPicture(tes2)
       Next i
     End If
  
  End If
  
  
  
endaa:
  
  

End If


End If


     
End Sub

Sub timea()
Dim a1, a2 As Integer
'a1 = Val(Second(Time))
'Do
'a2 = Val(Second(Time))
'DoEvents
'wait1 = True
'If a2 > a1 Then Exit Do
'Loop
'wait1 = False
For a1 = 0 To 5000
DoEvents
wait1 = True
Next a1
wait1 = False

End Sub

Sub diandao()
Dim temp, i, j As Integer
Dim k As Integer
For j = 0 To 10
For i = 0 To 8
temp = map(j, 8 - i)
map(j, 8 - i) = map(j, 10 + i)
map(j, 10 + i) = temp
Next i
Next j
For k = 0 To 208
Image1(k).Picture = LoadPicture("")
If map(tosx(k), tosy(k)) <> 0 Then
Image1(k).Picture = LoadPicture("tb\" + Trim(str(map(tosx(k), tosy(k)))) + ".jpg")
End If
Next k
'7,11
'6,12
'5,13
'4,14
'3,15
'2,16
'1,17
'0,18

End Sub

Sub nuodong()
Dim i, j As Integer
Dim k As Integer
For kk = 0 To 10
For i = 0 To 8
   For j = 0 To 18
      If map(i, j) <> 0 Then
         If map(i + 1, j) = 0 Then
            map(i + 1, j) = map(i, j)
            map(i, j) = 0
         End If
      End If
   Next j
Next i
Next kk
For k = 0 To 208
Image1(k).Picture = LoadPicture("")
If map(tosx(k), tosy(k)) <> 0 Then
Image1(k).Picture = LoadPicture("tb\" + Trim(str(map(tosx(k), tosy(k)))) + ".jpg")
End If
Next k

End Sub

Sub ints(s As Integer)
's = 0 '普通
's = 1 '简单
Dim i As Integer

Dim sdata As String

For i = 0 To 208         '调整编辑模式的控件长宽
Image1(i).BorderStyle = 0
Image1(i).Width = 570
Image1(i).Height = 645
Image1(i).Stretch = False
map(tosx(i), tosy(i)) = 0
Image1(i).Picture = LoadPicture("")

Next i

Randomize (Timer)
If woshisrv = True Then levelnow = Int(Rnd * 10 + 1)
'editmap   '编辑地图
If s = 0 Then levelnow = 20
levelmap (levelnow)


If woshisrv = True Then
   For i = 0 To 10
      For j = 0 To ly
         
          sdata = sdata + str(map(i, j)) + ","
         
      Next j
   Next i
End If

If Winsock1.State = sckConnected Then Winsock1.SendData sdata
搜索更多相关主题的帖子: 成员 数据 
2008-03-07 21:48
快速回复:方法和数据成员未找到 错误461 要怎么解决啊
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025122 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved