Download File: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=External Assemblies= To download a file a C# scripted function, you must first go to the .NET Global section, and in the External Assemblies box, enter the following: ''Syste...") |
No edit summary |
||
Line 7: | Line 7: | ||
{ | { | ||
return new System.Net.WebClient().DownloadData("https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png"); | return new System.Net.WebClient().DownloadData("https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png"); | ||
} | } | ||
</source> | </source> | ||
Line 16: | Line 15: | ||
{ | { | ||
return Convert.ToBase64String(new System.Net.WebClient().DownloadData("https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png")); | return Convert.ToBase64String(new System.Net.WebClient().DownloadData("https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png")); | ||
} | } | ||
</source> | </source> |
Revision as of 19:48, 14 November 2017
External Assemblies
To download a file a C# scripted function, you must first go to the .NET Global section, and in the External Assemblies box, enter the following: System.dll,System.Net.dll
C# Script to Download file as a byte array
object ScriptedField() { return new System.Net.WebClient().DownloadData("https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png"); }
C# Script to Download file as a Base64 string
object ScriptedField() { return Convert.ToBase64String(new System.Net.WebClient().DownloadData("https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png")); }