Jump to content

mofareh

Members
  • Content Count

    20
  • Joined

  • Last visited

Everything posted by mofareh

  1. mofareh

    order by string same integer

    hello frendes , can i sort data same the attachment photo ? by order by in sql server
  2. mofareh

    order by string same integer

    thank you for all it is done by ORDER BY Cast ('/' + acc_numb + '/' AS HIERARCHYID)
  3. mofareh

    order by string same integer

    try it by this data it is not done , the data is ready no insert or update data procedure TForm2.Button1Click(Sender: TObject); var LArr: TArray<string>; begin LArr := ['1','1.1','1.1.1','1.1.1.1','1.1.1.2','1.1.1.3','1.1.1.4','1.1.1.5','1.1.1.6','1.1.1.7','1.1.2' ,'1.1.2.1','1.1.2.2','1.1.3','1.1.3.1','1.1.4','1.1.4.1','1.1.4.2','1.1.5','1.1.5.1','1.1.6','1.1.6.1' ,'1.1.6.2 ','1.2','1.2.1','1.2.1.1','1.2.1.10','1.2.1.11','1.2.1.2','1.2.1.3','1.2.1.4','1.2.1.5' ,'1.2.1.6','1.2.1.7','1.2.1.8','1.2.1.9' ]; TArray.Sort<string>(LArr); Memo1.Lines.AddStrings(LArr); // // normalized Memo1.Lines.Add('---- Normalized ----'); LArr := ['1','1.1','1.1.1','1.1.1.1','1.1.1.2','1.1.1.3','1.1.1.4','1.1.1.5','1.1.1.6','1.1.1.7','1.1.2' ,'1.1.2.1','1.1.2.2','1.1.3','1.1.3.1','1.1.4','1.1.4.1','1.1.4.2','1.1.5','1.1.5.1','1.1.6','1.1.6.1' ,'1.1.6.2 ','1.2','1.2.1','1.2.1.1','1.2.1.10','1.2.1.11','1.2.1.2','1.2.1.3','1.2.1.4','1.2.1.5' ,'1.2.1.6','1.2.1.7','1.2.1.8','1.2.1.9']; TArray.Sort<string>(LArr); Memo1.Lines.AddStrings(LArr); end;
  4. mofareh

    order by string same integer

    i have error in TArray.Sort<string>(LArr);
  5. mofareh

    order by string same integer

    tank you for reply, but there is anather data has only one dot same : 1.1 1.2 i want to sort all data
  6. hello there this code for send image to whatsapp api i have this code but the parameters post with QueryString ... i want to post parameters with data forms var client := TRESTClient.Create('https://api.ultramsg.com/instance16802/messages/image'); var request := TRESTRequest.Create(nil); var esponse := TRESTResponse.Create(nil); request.Client := client; request.Response := esponse; client.ContentType:= 'application/x-www-form-urlencoded'; request.Method := TRESTRequestMethod.rmPOST; request.AddParameter('token','xxxxxx', TRESTRequestParameterKind.pkGETorPOST); request.AddParameter('to','+0000000', TRESTRequestParameterKind.pkGETorPOST); request.AddParameter('image',file2, TRESTRequestParameterKind.pkGETorPOST); //file2 as string : converted image to base64 request.Execute; Memo1.Text := request.Response.Content;
  7. hi , i have triel version of TMS Web Core for delphi , i want to buy it after trying if i try to show data in webdbgride the data not showing , i use MiletusMSSQLDBDriver , MiletusClientDataSet to do that , and i but all properties
  8. mofareh

    any one work in TMS Web core ?

    than you for replay the problem is still
  9. the code is vb.net ... i want to write it by delphi Sub Main(filename As String, MassegeTxt As String, mobileNo As String) ''''' send image as base64 Dim WebRequest As HttpWebRequest Dim bytes As Byte() = IO.File.ReadAllBytes(filename) Dim file As String = Convert.ToBase64String(bytes) 'Dim mof As String = HttpUtility.UrlEncode(file) Dim instance_id As String = "instance xxxxx" Dim token As String = "xxxxxxx" Dim mobile_number As String = mobileNo WebRequest = HttpWebRequest.Create("https://api.ultramsg.com/" + instance_id + "/messages/image") Dim postdata As String = "token=" + token + "&to=" + mobileNo + "&image=" & HttpUtility.UrlEncode(file) & "&caption=" + MassegeTxt Dim enc As UTF8Encoding = New System.Text.UTF8Encoding() Dim postdatabytes As Byte() = enc.GetBytes(postdata) WebRequest.Method = "POST" WebRequest.ContentType = "application/x-www-form-urlencoded" WebRequest.GetRequestStream().Write(postdatabytes) Dim ret As New System.IO.StreamReader(WebRequest.GetResponse().GetResponseStream()) Console.WriteLine(ret.ReadToEnd()) End Sub
  10. How can I thank you?? The code is post correctly Thank you very much
  11. I am delphi developer but i want helping Help me or stop question
  12. i dont know the vb.net i need any devlober write code by vb.net and delphi we dont have team we small busnse
  13. mofareh

    post image base64 to whatsapp api

    this code by c# but i want it by delphi pascal using System; using RestSharp; using System.Threading.Tasks; namespace test { class Program { static async Task Main(string[] args) { string instanceId = "instance950"; // your instanceId string token = "yourtoken"; //instance Token string mobile = "14155552671"; var url = "https://api.ultramsg.com/" + instanceId + "/messages/image"; var client = new RestClient(url); var request = new RestRequest(url, Method.Post); request.AddHeader("content-type", "application/x-www-form-urlencoded"); request.AddParameter("token", token); request.AddParameter("to", mobile); request.AddParameter("image", "https://file-example.s3-accelerate.amazonaws.com/images/test.jpg"); request.AddParameter("caption", "caption text"); RestResponse response = await client.ExecuteAsync(request); var output = response.Content; Console.WriteLine(output); } } }
  14. mofareh

    post image base64 to whatsapp api

    the response is : 414 Request-URI Too Large the API supoort sayd the paramerter post with QuireyString and he want to post parameter to Form values
  15. mofareh

    post image base64 to whatsapp api

    can i sent with Form values? the code sent QuireyString i want Form values method
  16. mofareh

    post image base64 to whatsapp api

    than you for remark , the code done : procedure Tmain_frm.Button6Click(Sender: TObject); var byte1: TBytes; file2: string; LJSONObject: TJSONObject; base64: TBase64Encoding; begin if OpenDialog1.Execute then begin /// / begin encodein base64 byte1 := System.iOUtils.TFile.ReadAllBytes(OpenDialog1.FileName); base64 := TBase64Encoding.Create(0); // CharsPerLine = 0 means no line breaks try file2 := base64.EncodeBytesToString(byte1); finally base64.Free; end; var Client := TRESTClient.Create('https://api.ultramsg.com/instance16802/messages/image'); var request := TRESTRequest.Create(nil); var esponse := TRESTResponse.Create(nil); request.Client := Client; request.Response := esponse; Client.ContentType := 'application/x-www-form-urlencoded'; request.Method := TRESTRequestMethod.rmPOST; LJSONObject := TJSONObject.Create(); try LJSONObject.AddPair('token', token_txt.text); LJSONObject.AddPair('to', send_to_txt.text); LJSONObject.AddPair('image', file2); request.AddBody(LJSONObject); request.Execute; Memo1.Text := request.Response.Content; finally LJSONObject.Free; end; end; end;
  17. mofareh

    post image base64 to whatsapp api

    i sent it to your Email
  18. mofareh

    post image base64 to whatsapp api

    i try it not done give me your email to sent token to you an try
  19. mofareh

    post image base64 to whatsapp api

    thank you for replay i find the way below when i change parameter to TJSONObject it is done : procedure TForm6.Button8Click(Sender: TObject); var byte1: TBytes; file2:widestring; LJSONObject: TJSONObject; begin if OpenDialog1.Execute then try //// begin encodein base64 byte1:=System.iOUtils.TFile.ReadAllBytes(OpenDialog1.FileName); file2:= TNetEncoding.Base64.EncodeBytesToString(byte1); file2:=trim(StringReplace(StringReplace(file2, #10, '', [rfReplaceAll]), #13, '',[rfReplaceAll])); //// end encodein base64 var client := TRESTClient.Create('https://api.ultramsg.com/instance16802/messages/image'); var request := TRESTRequest.Create(nil); var esponse := TRESTResponse.Create(nil); request.Client := client; request.Response := esponse; client.ContentType:= 'application/x-www-form-urlencoded'; request.Method := TRESTRequestMethod.rmPOST; LJSONObject := TJSONObject.Create(); LJSONObject.AddPair('token','xxxxxx'); LJSONObject.AddPair('to','+00000000'); LJSONObject.AddPair('image', file2); request.AddBody(LJSONObject); request.Execute; Memo1.Text := request.Response.Content; finally LJSONObject.Free; end; end;
×