当前位置: 首页>>代码示例>>C#>>正文


C# StringCollection.ToString方法代码示例

本文整理汇总了C#中System.Collections.Specialized.StringCollection.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# StringCollection.ToString方法的具体用法?C# StringCollection.ToString怎么用?C# StringCollection.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Collections.Specialized.StringCollection的用法示例。


在下文中一共展示了StringCollection.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnInstall_Click

        private void btnInstall_Click(object sender, EventArgs e)
        {
            string workDir = AppDomain.CurrentDomain.BaseDirectory + "/installer_tmp/";
            if (Directory.Exists(workDir))
                Directory.CreateDirectory(workDir);

            FileStream fs = new FileStream(Application.ExecutablePath, FileMode.Open, FileAccess.Read, FileShare.Read);
            BinaryReader reader = new BinaryReader(fs);
            MessageBox.Show("exeLength:" + fs.Length);
            fs.Position = fs.Length - 20 + 7;
            int exeLength = int.Parse(reader.ReadString());
            MessageBox.Show("exe Length:" + exeLength);
            long start = exeLength;
            MessageBox.Show("start : " + start);
            fs.Position = start;
            MessageBox.Show("position" + fs.Position);
            string instruction = reader.ReadString();
            MessageBox.Show("instruction : " + instruction);

            File.WriteAllText(workDir + "instruction.tmp", instruction);
            string config = reader.ReadString();
            MessageBox.Show("config:" + config);
            File.WriteAllText(workDir + "config.tmp", config);

            this.txtDescription.Text = instruction;

            Whats.Core.INI ini = new Core.INI(workDir + "config.tmp");
            StringCollection dirs = new StringCollection();
            ini.ReadSection("Dirs", dirs);
            foreach(var item in dirs)
            {
                Directory.CreateDirectory(item.Replace("~", workDir));
            }
            MessageBox.Show(dirs.ToString());
            StringCollection files = new StringCollection();
            ini.ReadSection("Files", files);
            foreach(var item in files)
            {
                FileInfo fileInfo = new FileInfo(item.Replace("~", workDir));
                if (!fileInfo.Directory.Exists)
                    Directory.CreateDirectory(fileInfo.Directory.FullName);
                var bytes = reader.ReadBytes(ini.ReadInteger("Files", item, 0));
                File.WriteAllBytes(fileInfo.FullName, bytes);
            }

            reader.Close();
            //Directory.Delete(workDir, true);
        }
开发者ID:Jeremaihloo,项目名称:CSharpProject,代码行数:48,代码来源:Installer.cs

示例2: ArgumentTypesToString

 /**
  * ȡ�ò����ַ�����
  *
  * @param argTypes
  * @return
  */
 public static string ArgumentTypesToString(Type[] argTypes)
 {
     StringCollection buf = new StringCollection();
     buf.Add("(");
     if (argTypes != null) {
         for (int i = 0; i < argTypes.Length; i++) {
             if (i > 0) {
                 buf.Add(", ");
             }
             Type t = argTypes[i];
             buf.Add((t == null) ? "null" : t.Name);
         }
     }
     buf.Add(")");
     return buf.ToString();
 }
开发者ID:jihadbird,项目名称:firespider,代码行数:22,代码来源:IOCCommon.cs

示例3: bbi_Drop

        void bbi_Drop(object sender, DragEventArgs e)
        {


            System.Windows.Point pt = e.GetPosition(sender as IInputElement);


            if ((sender as BreadcrumbBarItem).ShellObject.IsFileSystemObject)
            {
                if ((e.KeyStates & DragDropKeyStates.ControlKey) == DragDropKeyStates.ControlKey)
                {
                    e.Effects = DragDropEffects.Copy;
                    if (e.Data.GetDataPresent(DataFormats.FileDrop))
                    {
                        DropData PasteData = new DropData();
                        String[] collection = (String[])e.Data.GetData(DataFormats.FileDrop);
                        StringCollection scol = new StringCollection();
                        scol.AddRange(collection);
                        PasteData.DropList = scol;
                        PasteData.PathForDrop = (sender as BreadcrumbBarItem).ShellObject.ParsingName;
                        AddToLog("Copied Files to " + PasteData.PathForDrop + " Files copied: " + scol.ToString());
                        Thread t = null;
                        t = new Thread(new ParameterizedThreadStart(Explorer.DoCopy));
                        t.SetApartmentState(ApartmentState.STA);
                        t.Start(PasteData);
                    }
                }
                else
                {
                    //if (Path.GetPathRoot((sender as CloseableTabItem).Path.ParsingName) ==
                    //    Path.GetPathRoot(Explorer.NavigationLog.CurrentLocation.ParsingName))
                    //{
                    e.Effects = DragDropEffects.Move;
                    if (e.Data.GetDataPresent(DataFormats.FileDrop))
                    {
                        DropData PasteData = new DropData();
                        String[] collection = (String[])e.Data.GetData(DataFormats.FileDrop);
                        StringCollection scol = new StringCollection();
                        scol.AddRange(collection);
                        PasteData.DropList = scol;
                        PasteData.PathForDrop = (sender as BreadcrumbBarItem).ShellObject.ParsingName;
                        AddToLog("Moved Files to " + PasteData.PathForDrop + " Files moved: " + scol.ToString());
                        Thread t = null;
                        t = new Thread(new ParameterizedThreadStart(Explorer.DoMove));
                        t.SetApartmentState(ApartmentState.STA);
                        t.Start(PasteData);
                    }

                    //}
                    //else
                    //{
                    //    e.Effects = DragDropEffects.Copy;
                    //    if (e.Data.GetDataPresent(DataFormats.FileDrop))
                    //    {
                    //        DropData PasteData = new DropData();
                    //        String[] collection = (String[])e.Data.GetData(DataFormats.FileDrop);
                    //        StringCollection scol = new StringCollection();
                    //        scol.AddRange(collection);
                    //        PasteData.DropList = scol;
                    //        PasteData.PathForDrop = (sender as CloseableTabItem).Path.ParsingName;
                    //        Thread t = null;
                    //        t = new Thread(new ParameterizedThreadStart(Explorer.DoCopy));
                    //        t.SetApartmentState(ApartmentState.STA);
                    //        t.Start(PasteData);
                    //    }

                    //}
                }
            }
            else
            {
                e.Effects = DragDropEffects.None;
            }


            DropTargetHelper.Drop(e.Data, pt, e.Effects);
        }
开发者ID:rad1oactive,项目名称:BetterExplorer,代码行数:77,代码来源:MainWindow.xaml.cs


注:本文中的System.Collections.Specialized.StringCollection.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。