P
Pawel Korczak
Guest
Chciałem połączyć procedurę napisaną w C# z procedurą AppServera ( 11.4 ). Procedura banalnie prosta a ważne jak to zrobić.Może ktoś już miał takie doświadczenia ? Przykład wywołania w AppServer : PROCEDURE GetGoogleMapsBMP EXTERNAL "e:\progress\syse\GetImageBMP.exe" : DEFINE INPUT PARAMETER xUrl AS CHARACTER NO-UNDO. DEFINE INPUT PARAMETER Plik AS CHARACTER NO-UNDO. END . Przykład kodu w C# . using System.Net; using System.IO; using System.Runtime.InteropServices; namespace GetHTTP { class Program { static string FielLog = @"e:\log\_google.txt"; static void Main(string[] args) { GetHttpDane(args[0].Replace("$1$", "&"), args[1]); } static void GetHttpDane ( string xUrl , string Plik ) { try { WebRequest request = WebRequest.Create(xUrl); request.Headers.Add("Accept-Language
l"); using (WebResponse response = request.GetResponse()) { using (StreamReader stream = new StreamReader(response.GetResponseStream())) File.WriteAllText(Plik, stream.ReadToEnd()); } } catch (System.Exception zx ) { } } } }
Continue reading...
Continue reading...