using System; using System.Linq; using System.Collections.Generic; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; using System.Diagnostics; using System.Net; using System.IO; namespace cAlgo { [Robot(
using System; using System.Linq; using System.Collections.Generic; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; using System.Diagnostics; using System.Net; using System.IO; namespace cAlgo { [Robot(
07 Apr 2015, 20:55
using System; using System.Linq; using System.Collections.Generic; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; using System.Diagnostics; using System.Net; using System.IO; namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class test : Robot { [Parameter("Source")] public DataSeries Source { get; set; } [Parameter("Volume", DefaultValue = 10000, MinValue = 1000)] public int Volume { get; set; } [Parameter("TP", DefaultValue = 10)] public int TP { get; set; } [Parameter("SL", DefaultValue = 10)] public int SL { get; set; } string s; protected override void OnStart() { WebClient w = new WebClient(); s = w.DownloadString("http://http://test.psychologies.com/"); string desktopFolder = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); StreamReader reader = File.OpenText("C:\\Users\\othmane\\Documents\\cAlgo\\Sources\\Robots\\filename.txt"); string line; while ((line = reader.ReadLine()) != null) { Print(line); } } }
Hello everyone,
i have a weird problem here. I want to be able to send a request to a web page in order to fetch some data. But the "DownLoadString" method doest work. I have some credentials problems apparently. I dont know why i have this message :
- 08/03/2015 22:05:00.000 | Crashed in OnStart with SecurityException: Échec de la demande d'autorisation de type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Same things goes for the "GetFolderPath" method. I have this time another error message :
- 08/03/2015 22:05:00.000 | Crashed in OnStart with SecurityException: Échec de la demande d'autorisation de type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Can anyone help me with this matter ?
Many thanks,
Othmane
Invalid
08 Apr 2015, 09:51
Change AccessRights in your attribute to Full Access.
Check here
@Invalid