JLChen
2020-04-03 be95e839f40eb3ddf64706b60cba6dfcf4fad5e5
Crabtree/SmartHome/UI/SimpleControl/Phone/Music/MyMusic.cs
@@ -33,7 +33,7 @@
                var webClient = new Shared.Net.MyWebClient (2000);
                return webClient.DownloadString (url);
            } catch (Exception e) {
                System.Console.WriteLine (e.Message);
                Utlis.WriteLine (e.Message);
                return null;
            }
        }
@@ -50,7 +50,7 @@
                        thread.Abort ();
                    }
                } catch (Exception e) {
                    System.Console.WriteLine (e.Message);
                    Utlis.WriteLine (e.Message);
                }
            }
        }
@@ -63,7 +63,7 @@
                    threadLists.Remove (thread);
                    thread.Abort ();
                } catch (Exception e) {
                    System.Console.WriteLine (e.Message);
                    Utlis.WriteLine (e.Message);
                }
            }
        }
@@ -226,10 +226,10 @@
                                            }
                                        }
                                    }
                                } catch (Exception e) { System.Console.WriteLine (e.Message); }
                                } catch (Exception e) { Utlis.WriteLine (e.Message); }
                            }
                        } catch (Exception e) { System.Console.WriteLine (e.Message); } finally {
                        } catch (Exception e) { Utlis.WriteLine (e.Message); } finally {
                            Application.RunOnMainThread (() => {
                                MainPage.Loading.Hide ();
                                if (d) {
@@ -393,7 +393,7 @@
                            a31MusicModel.IsCanShow = true;
                            a31MusicModel.IsOnLine = true;
                        }
                    } catch (Exception e) { System.Console.WriteLine (e.Message); }
                    } catch (Exception e) { Utlis.WriteLine (e.Message); }
                });
            }
        }
@@ -595,7 +595,7 @@
                    try {
                        udpClient = new System.Net.Sockets.UdpClient (localPort);
                        break;
                    } catch (Exception e) { System.Console.WriteLine (e.Message); }
                    } catch (Exception e) { Utlis.WriteLine (e.Message); }
                }
                System.Threading.Tasks.Task.Run (() => {
@@ -620,7 +620,7 @@
                                //如果1000毫秒没有数据回复,就关闭当前Socket,不再等待接收数据
                            }
                            System.Threading.Thread.Sleep (500);
                        } catch (Exception e) { System.Console.WriteLine (e.Message); }
                        } catch (Exception e) { Utlis.WriteLine (e.Message); }
                    }
                });
                while (true) {
@@ -640,7 +640,7 @@
                            try {
                                udpClient.Close ();
                                udpClient = null;
                            } catch (Exception e) { System.Console.WriteLine (e.Message); }
                            } catch (Exception e) { Utlis.WriteLine (e.Message); }
                            break;
                        }
@@ -652,7 +652,7 @@
                        //一行一行数据判断,找出需要的信息
                        while ((tempLine = sr.ReadLine ()) != null) {
                            //找出Ip地址相关的信息
                            //System.Console.WriteLine (tempLine);
                            //Utlis.WriteLine (tempLine);
                            if (tempLine.StartsWith ("LOCATION: http://")) {
                                tempLine = tempLine.Replace ("LOCATION: http://", "").Split ('/') [0];
                                string [] ipAndPort = tempLine.Split (':');
@@ -676,11 +676,11 @@
                                try {
                                    udpClient.Close ();
                                    udpClient = null;
                                } catch (Exception e) { System.Console.WriteLine (e.Message); }
                                } catch (Exception e) { Utlis.WriteLine (e.Message); }
                                break;
                            }
                        }
                    } catch (Exception e) { System.Console.WriteLine (e.Message); }
                    } catch (Exception e) { Utlis.WriteLine (e.Message); }
                }
            });
        }
@@ -986,7 +986,7 @@
                            }
                            #endregion
                        } catch (Exception e) {
                            System.Console.WriteLine (e.Message);
                            Utlis.WriteLine (e.Message);
                        }
                        refreshUI (a31image, a31player, a31horizontalSeekBarvol, a31btnPlayMusic, a31palyername, a31currentMusic, a31currentartist, serverOrClientBtn, a31frameLayout, colorBtn);
                    });
@@ -1205,7 +1205,7 @@
                    a31currentMusic.Enable = false;
                }
            } catch (Exception e) {
                System.Console.WriteLine (e.Message);
                Utlis.WriteLine (e.Message);
            }
        }
@@ -1339,7 +1339,7 @@
                a31MusicModel.A31PlayStatus.TrackURL = se.SearchForTextOfTag ("TrackURI");
            } catch (Exception ex) {
                Console.WriteLine (ex.Message);
                Utlis.WriteLine (ex.Message);
            }
        }
@@ -1361,7 +1361,7 @@
                string deviceType = null;
                while ((line = sr.ReadLine ()) != null) {
                    //System.Console.WriteLine (line);
                    //Utlis.WriteLine (line);
                    if (line.StartsWith ("<friendlyName>")) {
                        deviceName = line.Replace ("<friendlyName>", "").Replace ("</friendlyName>", "");
                    } else if (line.StartsWith ("<manufacturer>")) {
@@ -1379,7 +1379,7 @@
                }
            } catch (Exception e) {
                System.Console.WriteLine (e.Message);
                Utlis.WriteLine (e.Message);
            } finally {
                if (sr != null) {
                    sr.Close ();
@@ -1401,7 +1401,7 @@
                try {
                    byte [] recevieBytes1 = webClient.DownloadData (new Uri ("http://" + a31.IPAddress + "/httpapi.asp?command=setPlayerCmd:" + cmd));
                } catch (Exception e) {
                    System.Console.WriteLine (e.Message);
                    Utlis.WriteLine (e.Message);
                }
            });
        }