I am working on a language translation program where I get information from offline. I am using Unity game engine, which uses Assembly as its IDE. Below is my code so far.
class Dictionary
{
public string Translate(string input, string languagePair, Encoding encoding)
{
string url = String.Format("http://www.google.com/translate_t?hl=en&ie=UTF8&text={0}&langpair={1}", input, languagePair);
string result = String.Empty;
using (WebClient webClient = new WebClient())
{
webClient.Encoding = encoding;
result = webClient.DownloadString(url);
}
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(result);
return doc.DocumentNode.SelectSingleNode("//textarea[@name='utrans']").InnerText;
}
}
However, when compiling, I receive the error:
Assets/DictionarySp.cs(8,7): error CS0246: The type or namespace name `HtmlAgilityPack' could not be found. Are you missing a using directive or an assembly reference?
I began doing research and heard that HtmlAgilityPack was a third-party software, and that I had to reference the .dll. I downloaded VisualStudio2010, as well as NuGet. Inside of Visual Studio I clicked "Manage NuGet Packages" and installed the HtmlAgilityPack. Inside of Visual Studio the error went away, however when I tried to open the file in Assembly, I still receive the error that the namespace HtmlAgilityPack could not be found. I am using Unity game engine, so I have to take the file from the VisualStudio file and place it in a different folder. Is there some step that I am missing, or do I need to do something in assembly to reference the HtmlAgilityPack dll? Any help would be greatly appreciated.