Click here to Skip to main content
15,396,920 members

Comments by Luis M. Rojas (Top 5 by date)

Luis M. Rojas 4-Aug-22 14:20pm View
The result(the store procedure) has return a string: FACTURA VALIDA or FACTURA INVALIDA
Luis M. Rojas 2-Aug-22 12:54pm View
Well i just try to use this code:

json = tr.ReadToEnd();
dynamic result = JsonConvert.DeserializeObject(json);
foreach (dynamic paq in result)
string string2 = "contenido: " + paq.contenido;

But i got this error
Severity	Code	Description	Project	File	Line	Suppression State
Error	CS0656	Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'	Login	C:\Login\Login\Login\DisplayTracking.xaml.cs	69	Active

but i have the DLL installed in the reference of the project.
Luis M. Rojas 2-Aug-22 8:13am View
Hello, First i beg you pardon me, when i say: lastname, could be any fields, in my case it is a unique key: tracking number, and here is my class(package):
public class Package
// [JsonConverter(typeof(ParseStringConverter))]
public long IdTipoEnvio { get; set; }

public string Peso { get; set; }

public string TrackingNumber { get; set; }

public string Contenido { get; set; }

public string Guia { get; set; }

public string DescEstatusProceso { get; set; }

public long IdEstatusProceso { get; set; }

public string FecCreacion { get; set; }

public long Factura { get; set; }

public string Trackingestatus { get; set; }

public string Colorestatus { get; set; }

public string Imagenapp { get; set; }

public long Id { get; set; }

public string Urlfoto { get; set; }

public string Facturatext { get; set; }

public string Facturatext2 { get; set; }

public object Texto1 { get; set; }

public object Texto2 { get; set; }

public long MostrarBoton { get; set; }

public long Padre { get; set; }

public string TipoEnvio { get; set; }

public long ShowTipoEnvio { get; set; }
Luis M. Rojas 21-Jul-22 10:20am View
Excellent, that is it. Great. Thanks at lot. it is works
Luis M. Rojas 1-Jul-22 9:27am View
Well, i think YES. This is it what i want: I have a vitronic Machine which is running on a server (ip, port xxx), this program send an answer in XML, the host (ip, port yyy) has to read and send a XML and so on.
I found this code to send and Recive, but nothing happen.

private void startButton_Click(object sender, EventArgs e)
//IPEndPoint LocalEndpoint = new IPEndPoint(IPAddress.Parse(txtIP.Text), 20000);
IPEndPoint LocalEndpoint = new IPEndPoint(IPAddress.Parse(""), 20000);
Socket _Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

_Socket.BeginAccept(new AsyncCallback(Accept), _Socket);

private void Accept(IAsyncResult _IAsyncResult)
Socket AsyncSocket = (Socket)_IAsyncResult.AsyncState;
Socket dataSocket = AsyncSocket.EndAccept(_IAsyncResult);
var buffer = new byte[1024];
AsyncSocket.BeginReceive(buffer, 0, buffer.Length, SocketFlags.None, new AsyncCallback(Receive), dataSocket);


private void Receive(IAsyncResult _IAsyncResult)
Socket AsyncSocket = (Socket)_IAsyncResult.AsyncState;
var buffer = new byte[1024];
var strReceive = Encoding.ASCII.GetString(buffer);
txtXMLRecibido.Text +=strReceive;
AsyncSocket.BeginReceive(buffer, 0, buffer.Length, SocketFlags.None, new AsyncCallback(Receive), AsyncSocket);

private void button1_Click(object sender, EventArgs e)
//To conect to the server
if (txtIP.Text == "")
lblMensaje.Text = "Debe Digitar el IP";

if (txtPort.Text == "")
lblMensaje.Text = "Debe Digitar el número de Puerto";
IPEndPoint RemoteEndPoint = new IPEndPoint(IPAddress.Parse(txtIP.Text), Convert.ToInt32(txtPort.Text));
Socket _Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

_Socket.BeginConnect(RemoteEndPoint, new AsyncCallback(Connect), _Socket);

private void Connect(IAsyncResult _IAsyncResult)
Socket RemoteSocket = (Socket)_IAsyncResult.AsyncState;
catch (Exception ex)