24-10-21, 10:01 PM
(آخر تعديل لهذه المشاركة : 24-10-21, 10:09 PM {2} بواسطة MajedAlharbi.)
مرحبا
لدي رابط API من موقع QR Code Generator لإنشاء باركود
هذا الرابط: https://api.qr-code-generator.com/v1/cre...O2wG3a8Gvd
وهنا الشرح Use our QR Code API to automate QR Code creation on a large scale
قمت باختبار الرابط من موقع https://reqbin.com/
وهذه هي النتيجة :
....................
السؤال لدي تطبيق Windows Form
يوجد داخل الفورم PictureBox
وأريد اعرض صورة الباركود داخل PictureBox
وهذا الكود المستخدم
لدي رابط API من موقع QR Code Generator لإنشاء باركود
هذا الرابط: https://api.qr-code-generator.com/v1/cre...O2wG3a8Gvd
وهنا الشرح Use our QR Code API to automate QR Code creation on a large scale
قمت باختبار الرابط من موقع https://reqbin.com/
وهذه هي النتيجة :
....................
السؤال لدي تطبيق Windows Form
يوجد داخل الفورم PictureBox
وأريد اعرض صورة الباركود داخل PictureBox
وهذا الكود المستخدم
كود :
using System;
using System.IO;
using System.Net;
using System.Windows.Forms;
namespace TestAPI
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
var url = "https://api.qr-code-generator.com/v1/create?access-token=pmiDgwkqwHkTMZsWYEg06eVk7yRFo2nJPabT93T5rqcBuQtJsZfyOYO2wG3a8Gvd";
var httpRequest = (HttpWebRequest)WebRequest.Create(url);
httpRequest.Method = "POST";
httpRequest.ContentType = "application/json";
var data = @"{
""frame_name"": ""no-frame"",
""qr_code_text"": ""https://www.qr-code-generator.com/"",
""image_format"": ""JPG"",
""qr_code_logo"": ""scan-me-square"",
""download"": 1
}";
using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream()))
{
streamWriter.Write(data);
}
var httpResponse = (HttpWebResponse)httpRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var result = streamReader.ReadToEnd();
}
}
}
}