⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vcard.cs

📁 老外Logix Mobile mCoreLib短信控件源码 通过串口或者手机数据线进行连接,可对手机进行 读写操作.
💻 CS
📖 第 1 页 / 共 5 页
字号:
                    finally
                    {
                        Monitor.Exit(this.a);
                    }
                }
                else
                {
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [vCard:Send_Class:Send:A]", "VCARD");
                    this.aa = false;
                }
            }

            internal void c()
            {
                string str = "";
                try
                {
                    this.a.av();
                    if (!this.a.af)
                    {
                        this.b.q.a(true);
                    }
                    if (this.a.ah == this.a.b9)
                    {
                        this.a.a(0x1f56L, this.a.l("odumu5VOg_:5-26cCP/GtqPa6g$"), "VCARD");
                    }
                    else if (this.c.Length <= 0)
                    {
                        this.a.a(0x1f57L, "Destination mobile number not defined", "VCARD");
                    }
                    else if (((this.h.Length <= 0) & (this.j.Length <= 0)) & (this.i.Length <= 0))
                    {
                        this.a.a(0x1f58L, "Contact name is not defined", "VCARD");
                    }
                    else if ((((this.d.Length <= 0) & (this.e.Length <= 0)) & (this.f.Length <= 0)) & (this.g.Length <= 0))
                    {
                        this.a.a(0x1f59L, "Contact phone not defined", "VCARD");
                    }
                    else
                    {
                        str = this.a();
                        if (str.Length > 0)
                        {
                            this.ac = this.b.objQueue.a(this.c, str, this.ab, this.y, this.z);
                        }
                    }
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    this.b.r.b("[vCard:Send_Class:SendQ:1] " + exception.Message);
                    ProjectData.ClearProjectError();
                }
            }
        }

        private class b
        {
            private f a;
            private SMS b;
            private int c;
            private bool d = false;
            private string e = "";
            private string f = "";
            private string g;
            internal bool h = false;
            internal string i = "";
            internal int j;
            internal string k;

            internal b(ref SMS A_0, string A_1, string A_2, string A_3, int A_4, bool A_5)
            {
                this.b = A_0;
                this.a = this.b.gm;
                this.e = A_1;
                this.f = A_2;
                this.g = A_3;
                this.c = A_4;
                this.d = A_5;
            }

            internal void a()
            {
                if (Monitor.TryEnter(this.a, this.a.@as))
                {
                    string str = "";
                    this.h = false;
                    this.i = "";
                    try
                    {
                        this.a.av();
                        if (!this.a.af)
                        {
                            this.b.q.a(true);
                        }
                        if (this.a.ah == this.a.b9)
                        {
                            this.a.a(0x1f56L, this.a.l("odumu5VOg_:5-26cCP/GtqPa6g$"), "VCARD");
                        }
                        else if (this.f.Length <= 0)
                        {
                            this.a.a(0x1f57L, "Destination mobile number not defined", "VCARD");
                        }
                        else if ((this.e.Length > 0) & this.e.ToUpper().EndsWith(".VCF"))
                        {
                            if (File.Exists(this.e))
                            {
                                if (string.Compare(this.a.ah, this.a.b8, true) == 0)
                                {
                                    string[] strArray;
                                    try
                                    {
                                        strArray = File.ReadAllLines(this.e);
                                    }
                                    catch (ArgumentException exception1)
                                    {
                                        ProjectData.SetProjectError(exception1);
                                        ArgumentException exception = exception1;
                                        this.a.a(0x1f88L, "Invalid vCard file name", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (PathTooLongException exception18)
                                    {
                                        ProjectData.SetProjectError(exception18);
                                        PathTooLongException exception2 = exception18;
                                        this.a.a(0x1f8bL, "The specified path, file name, or both exceed the system defined maximum length", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (DirectoryNotFoundException exception19)
                                    {
                                        ProjectData.SetProjectError(exception19);
                                        DirectoryNotFoundException exception3 = exception19;
                                        this.a.a(0x1f8cL, "The specified path for vCard file is invalid", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (FileNotFoundException exception20)
                                    {
                                        ProjectData.SetProjectError(exception20);
                                        FileNotFoundException exception4 = exception20;
                                        this.a.a(0x1f8dL, "The specified vCard file [" + this.e + "] not found", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (IOException exception21)
                                    {
                                        ProjectData.SetProjectError(exception21);
                                        IOException exception5 = exception21;
                                        this.a.a(0x1f8eL, "An I/O error occured while opening the vCard file", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (UnauthorizedAccessException exception22)
                                    {
                                        ProjectData.SetProjectError(exception22);
                                        UnauthorizedAccessException exception6 = exception22;
                                        this.a.a(0x1f8fL, "Permission denied to access the vCard file", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (NotSupportedException exception23)
                                    {
                                        ProjectData.SetProjectError(exception23);
                                        NotSupportedException exception7 = exception23;
                                        this.a.a(0x1f90L, "The specified vCard file path is in an invalid format", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (SecurityException exception24)
                                    {
                                        ProjectData.SetProjectError(exception24);
                                        SecurityException exception8 = exception24;
                                        this.a.a(0x1f91L, "Insufficient permission to access the vCard file", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    if (this.a.z > 0L)
                                    {
                                        return;
                                    }
                                    if (strArray.GetUpperBound(0) > 0)
                                    {
                                        int upperBound = strArray.GetUpperBound(0);
                                        for (int i = 0; i <= upperBound; i++)
                                        {
                                            if (strArray[i].ToUpper().StartsWith("TEL;") | strArray[i].ToUpper().StartsWith("TEL:"))
                                            {
                                                strArray[i] = strArray[i] + this.g;
                                            }
                                            str = str + strArray[i] + "\r\n";
                                        }
                                    }
                                }
                                else
                                {
                                    try
                                    {
                                        str = File.ReadAllText(this.e);
                                    }
                                    catch (ArgumentException exception25)
                                    {
                                        ProjectData.SetProjectError(exception25);
                                        ArgumentException exception9 = exception25;
                                        this.a.a(0x1f88L, "Invalid vCard file name", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (PathTooLongException exception26)
                                    {
                                        ProjectData.SetProjectError(exception26);
                                        PathTooLongException exception10 = exception26;
                                        this.a.a(0x1f8bL, "The specified path, file name, or both exceed the system defined maximum length", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (DirectoryNotFoundException exception27)
                                    {
                                        ProjectData.SetProjectError(exception27);
                                        DirectoryNotFoundException exception11 = exception27;
                                        this.a.a(0x1f8cL, "The specified path for vCard file is invalid", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (FileNotFoundException exception28)
                                    {
                                        ProjectData.SetProjectError(exception28);
                                        FileNotFoundException exception12 = exception28;
                                        this.a.a(0x1f8dL, "The specified vCard file [" + this.e + "] not found", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (IOException exception29)
                                    {
                                        ProjectData.SetProjectError(exception29);
                                        IOException exception13 = exception29;
                                        this.a.a(0x1f8eL, "An I/O error occured while opening the vCard file", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (UnauthorizedAccessException exception30)
                                    {
                                        ProjectData.SetProjectError(exception30);
                                        UnauthorizedAccessException exception14 = exception30;
                                        this.a.a(0x1f8fL, "Permission denied to access the vCard file", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (NotSupportedException exception31)
                                    {
                                        ProjectData.SetProjectError(exception31);
                                        NotSupportedException exception15 = exception31;
                                        this.a.a(0x1f90L, "The specified vCard file path is in an invalid format", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    catch (SecurityException exception32)
                                    {
                                        ProjectData.SetProjectError(exception32);
                                        SecurityException exception16 = exception32;
                                        this.a.a(0x1f91L, "Insufficient permission to access the vCard file", "VCARD");
                                        ProjectData.ClearProjectError();
                                    }
                                    if (this.a.z > 0L)
                                    {
                                        return;
                                    }
                                }
                                if (str.Replace("\r", "").Replace("\n", "").Trim().Length > 0)
                                {
                                    this.i = this.a.a(str, this.f, this.c, this.d);
                                    goto Label_0582;
                                }
                                this.a.a(0x1f8aL, "vCard file is empty", "VCARD");
                            }
                            else
                            {
                                this.a.a(0x1f89L, "vCard file [" + this.e + "] not found", "VCARD");
                            }
                        }
                        else
                        {
                            this.a.a(0x1f88L, "Invalid vCard file name", "VCARD");
                        }
                        return;
                    Label_0582:
                        if (this.i.Trim().Length <= 0)
                        {
                            if ((this.a.b2 == 0L) && (this.a.z == 0L))
                            {
                                this.a.b2 = 0x1f9dL;
                                this.a.b1 = "vCard file send error";
                            }
                            if (this.a.b2 > 0L)
                            {
                                this.a.a(this.a.b2, this.a.b1, "VCARD");
                            }
                        }
                        else
                        {
                            this.h = true;
                        }
                    }
                    catch (Exception exception33)
                    {
                        ProjectData.SetProjectError(exception33);
                        Exception exception17 = exception33;
                        this.b.r.b("[vCard:SendFile_Class:Send:1] " + exception17.Message);
                        ProjectData.ClearProjectError();
                    }
                    finally
                    {
                        Monitor.Exit(this.a);
                    }
                }
                else
                {
                    this.a.a(0x2333L, "Thread monitor enter attempt timeout [vCard:SendFile_Class:Send:A]", "VCARD");
                    this.h = false;
                }
            }

            internal void b()
            {
                string str = "";
                try
                {
                    this.a.av();
                    if (!this.a.af)
                    {
                        this.b.q.a(true);
                    }
                    if (this.a.ah == this.a.b9)
                    {
                        this.a.a(0x1f56L, this.a.l("odumu5VOg_:5-26cCP/GtqPa6g$"), "VCARD");
                    }
                    else if (this.f.Length <= 0)
                    {
                        this.a.a(0x1f57L, "Destination mobile number not defined", "VCARD");
                    }
                    else if ((this.e.Length > 0) & this.e.ToUpper().EndsWith(".VCF"))
                    {
                        if (File.Exists(this.e))
                        {
                            if (string.Compare(this.a.ah, this.a.b8, true) == 0)
                            {
                                string[] strArray;
                                try
                                {
                                    strArray = File.ReadAllLines(this.e);
                                }
                                catch (ArgumentException exception1)
                                {
                                    ProjectData.SetProjectError(exception1);
                                    ArgumentException exception = exception1;
                                    this.a.a(0x1f88L, "Invalid vCard file name", "VCARD");
                                    ProjectData.ClearProjectError();
                                }
                                catch (PathTooLongException exception18)
                                {
                                    ProjectData.SetProjectError(exception18);
                                    PathTooLongException exception2 = exception18;
                                    this.a.a(0x1f8bL, "The specified path, file name, or both exceed the system defined maximum length", "VCARD");
                                    ProjectData.ClearProjectError();
                                }
                                catch (DirectoryNotFoundException exception19)
                                {
                                    ProjectData.SetProjectError(exception19);
                                    DirectoryNotFoundException exception3 = exception19;
                                    this.a.a(0x1f8cL, "The specified path for vCard file is invalid", "VCARD");
                                    ProjectData.ClearProjectError();
                                }
                                catch (FileNotFoundException exception20)
                                {
                                    ProjectData.SetProjectError(exception20);
                                    FileNotFoundException exception4 = exception20;
                                    this.a.a(0x1f8dL, "The specified vCard file [" + this.e + "] not found", "VCARD");
                                    ProjectData.ClearProjectError();
                                }
                                catch (IOException exception21)
                                {
                                    ProjectData.SetProjectError(exception21

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -