【发布时间】:2017-07-31 15:49:01
【问题描述】:
我在尝试为我的文本框创建自动完成时遇到了障碍。
尝试 #1
string[] fileDB = Account.filedbContents;
string[] lines = { };
using (StreamReader sr = new StreamReader(@FILE_PATH)
while ((textboxWebsite.Text = sr.ReadLine()) != null)
{
lines.Add(sr.ReadLine());
}
尝试 #2
textboxWebsite.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
textboxWebsite.AutoCompleteSource = AutoCompleteSource.CustomSource;
var autoComplete = new AutoCompleteStringCollection();
autoComplete.AddRange()
string[] substrings = new string[] { textboxWebsite.Text };
substrings.SelectMany(substring => Enumerable.Range(0, ))
string line = File.Read(@"C:\Users\snogueir\Desktop\Coding\sandbox\keychainarray.txt");
}
AutoCompleteStringCollection collection = new AutoCompleteStringCollection();
collection.AddRange(arr);
this.textboxWebsite.AutoCompleteCustomSource = collection;
头有点炸。我正在尝试为每当用户将网站输入文本框时进行自动完成,它将尝试在 .txt 文件(想象在文本框中输入“face”,如果存在则建议“facebook”)
website1=username1=password1
website2=username2=password2
website3=username3=password3
这些都不编译。
我正在考虑使用 String.Split('='),但我能想到的唯一方法是为每一行创建一个单独的数组,然后返回 credentialarray[0](因为那将是网站)。
救命!
【问题讨论】:
-
什么是编译错误?
标签: c# .net winforms autocomplete textbox