Member 11810225
Можете ли вы предоставить мне ссылку для загрузки инструментария??
это мой код
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//using System;
//using System.Text;
using System.Net;
using System.Net.Sockets;
using InTouchTagDictionaryLib;
using InTouchMultiTagDictionaryLib;
using INTOUCHPROXYPACKAGESERVERLib;
using INTOUCHTAGBROWSERLib;
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using aaGRAccessApp;
//using InTouchTagDictionaryLib;
using WWAPPINTLib;
using WWANIMATIONLib;
using WWAPPCNTXLib;
using WWPROVIDERREGLib;
namespace ConsoleApplication1
{
class Program
{
static void Main()
{
string SB = null;
Intouch IntouchToolkit = default(GRAccessApp);
IntouchToolkit = new GRAccessApp();
SB = IntouchToolkit.ReadString("SBuffer", 132);
sendToPrinter("10.1.10.40", "GEA AUTOMATION", 9100);
}
public static Boolean sendToPrinter(String server, String message, Int32 port)
{
string hexOutput = "";
try
{
string commandStart = "1b 4f 45 30 30 30";// 31 34"; // Start command
string commandEnd = "04"; // End command
string input = message;
string messageLength = input.Length.ToString();
input = messageLength + input;
string hexString = "";
char[] values = input.ToCharArray();
foreach (char letter in values)
{
// Get the integral value of the character.
int value = Convert.ToInt32(letter);
// Convert the decimal value to a hexadecimal value in string form.
hexOutput = String.Format("{0:X}", value);
hexString = hexString + hexOutput + " ";
Console.WriteLine("Hexadecimal value of {0} is {1}", letter, hexOutput);
}
input = commandStart + " " + hexString + commandEnd;
Console.WriteLine(input);
byte[] data = input.Split().Select(s => Convert.ToByte(s, 16)).ToArray();
TcpClient client = new TcpClient(server, port);
NetworkStream stream = client.GetStream();
stream.Write(data, 0, data.Length);
Console.WriteLine("Sent: {0}", message);
data = new Byte[256];
String responseData = String.Empty;
Int32 bytes = stream.Read(data, 0, data.Length);
responseData = System.Text.Encoding.UTF8.GetString(data, 0, bytes);
Console.WriteLine("Received: {0}", responseData);
// Close everything.
stream.Close();
client.Close();
}
catch (ArgumentNullException e)
{
Console.WriteLine("ArgumentNullException: {0}", e);
return false;
}
catch (SocketException e)
{
Console.WriteLine("SocketException: {0}", e);
return false;
}
return true;
}
}
}
Richard MacCutchan
Как вы можете пытаться использовать этот инструментарий, если вы не установили его в своей системе и даже не знаете, откуда его скачать?
Member 11810225
у меня на компьютере установлена Visual Studio..
В этом m пытается это сделать ..но m не получает точной ссылки, которая будет добавлена для использования этой функции
[
Intouch IntouchToolkit = по умолчанию(Intouch);
IntouchToolkit = новый Intouch(0,0);
SB = IntouchToolkit. ReadString ("SBuffer", 132);
]
по ключевому слову intouch я получаю эту ошибку
Ошибка 5 не удалось найти тип или имя пространства имен "Intouch" (отсутствует ли директива using или ссылка на сборку?) C:\Users\Administrator\Documents\Visual Studio 2013\Projects\ConsoleApplication1\ConsoleApplication1\Program_00. cs 37 13 ConsoleApplication1