|
I do have a habit of over-explaining However, if I'd posted it as an article I would be the first one to "report" it as wrong type ... should be a tip
|
|
|
|
|
CHill60 wrote: I do have a habit of over-explaining
That is a good habit.
CHill60 wrote: should be a tip No, for a tip it is TL;DR
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks Eddy for your valuable time which you took out for my work, thanks thanks again....!
|
|
|
|
|
It's a pleasure - but it wasn't Eddy who answered
|
|
|
|
|
Hi Everybody,
I'm new in c#, I am trying to create a c# application using Visual Studio 2013 Express. My application can not run in Windows XP, so what should I do? I hope anybody can help me please. Thank you in advance.
|
|
|
|
|
Make sure your target framework is 3.5 or lower. XP doesn't work with higher frameworks.
<sig notetoself="think of a better signature">
<first>Jim</first> <last>Meadors</last>
</sig>
|
|
|
|
|
Thank you so much, this is very useful for me
|
|
|
|
|
XP will work with framework 4.0 just not any higher than that.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Framework version 4 is still possible.
I am not sure if you can set the target to a specific version with the current Express Editions of Visual Studio. If you can't, try to get Visual Studio 2010 Express.
|
|
|
|
|
Unless you're writing commercial code as part of a large company, you might want to look at Visual Studio Community 2013[^]. It has a lot more features than the Express edition - it's essentially a free version of Visual Studio Professional.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi,
I have a card reader for read a user card but reading appears that:
<b>For user 7196: %00007196_ç00007196_ - this is a new card</b>
<b>For user 910202: ç00910202_ - this is a old card</b>
Another card reader appears:
<b>For user 7196: 00007196 - this is a new card</b>
<b>For user 910202: 00910202 - this is a old card</b>
The problem is when i pass the card the system sends all codes like a copy-paste but i need control this paste. Eliminate chars, etc...
This code receives all ps/2 codes:
<pre lang="c#">
using System;
using System.Diagnostics;
using System.Windows.Forms;
using System.Runtime.InteropServices;
class InterceptKeys
{
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool UnhookWindowsHookEx(IntPtr hhk);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr GetModuleHandle(string lpModuleName);
public static int _count = 0;
private const int WH_KEYBOARD_LL = 13;
private const int WM_KEYDOWN = 0x0100;
private static LowLevelKeyboardProc _proc = HookCallback;
private static IntPtr _hookID = IntPtr.Zero;
public static void Main()
{
_hookID = SetHook(_proc);
Application.Run();
UnhookWindowsHookEx(_hookID);
}
private static IntPtr SetHook(LowLevelKeyboardProc proc)
{
using (Process curProcess = Process.GetCurrentProcess())
using (ProcessModule curModule = curProcess.MainModule)
{
return SetWindowsHookEx(WH_KEYBOARD_LL, proc, GetModuleHandle(curModule.ModuleName), 0);
}
}
private delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);
private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
{
if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN)
{
int vkCode = Marshal.ReadInt32(lParam);
if ((Keys)vkCode == Keys.Return)
{
Console.WriteLine("Cartão novo lido com sucesso.");
}
Console.WriteLine((Keys)vkCode);
}
return CallNextHookEx(_hookID, nCode, wParam, lParam);
}
}
</pre>
<b>I need increase this code, any help?</b>
|
|
|
|
|
Please don't post the same thing in multiple places: it duplicates work and annoys people.
You already have this posted in QA, leave it there.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
ok, sorry. Wasnmy first question
|
|
|
|
|
I'm making an application that produce barcode labels. I'm using Sato LM408e thermal printer. In order to print i'm using sbpl command. I got no error but the printer doesnt print anything. Is there anyone who has experience printing with sato barcode printer? lm 408e to be more specific
My Code:
PrintDialog printDia = new PrintDialog();
printDia.PrinterSettings = new PrinterSettings();
DialogResult result = printDia.ShowDialog();
StringBuilder sb = new StringBuilder();
sb.AppendLine("<STX><ESC>A");
sb.AppendLine("<ESC>H0001<ESC>V0001<ESC>XM45676567");
sb.AppendLine("<ESC>Q1");
sb.AppendLine("<ESC>Z<ETX>")
String output = sb.ToString().Replace("<ESC>", ((char)27).ToString());
output.Replace("<STX>",((char)2).ToString());
output.Replace("<ETX>", ((char)3).ToString());
if (result == DialogResult.OK)
{
RawPrinterHelper.SendStringToPrinter(printDia.PrinterSettings.PrinterName, output);
}
and my output value :
http://imgur.com/hVCk2ic[^]
|
|
|
|
|
You should talk to the people who created the printer - they should provide technical support and will know more about their product than we will. If they don't, then find another supplier and demand your money back!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Hello guys,
I'm having a problem and, although I understand the problem, I can't find a solution to the problem.
I'm using NamedPipes and I have created this method to Serialise on object T to a byte[].
private byte[] Serialize(T obj)
{
using (var memoryStream = new MemoryStream())
{
oBinaryFormatter.Serialize(memoryStream, obj);
return memoryStream.ToArray();
}
}
I have a test that sends a object with 300Mb and the Serialization fails with a OutOfmemory.
oBinaryFormatter.Serialize(memoryStream, 300MbObject);
I understand that the problem is related to memory. Can you guys suggest another solution for this problem?
Thanks Guys
|
|
|
|
|
Don't use the BinaryFormatter for anything that size. I would recommend either using protobuf.net[^] or manual serializing: BinaryFormatter vs. Manual Serializing[^]. Both will be faster and more compact.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Since Google Code is shutting down, you may want to direct people to the correct homepage of protobuf.net[^] on Github.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Right - forgot about that. Thank you for the heads-up.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
A typical object is not 300Mb; that already counts as a rather large transfer of data. Do you need to have it completely in memory? If it represents "data", would it not be more logical to stream the data straight to file, as opposed to creating a very large object in memory?
The memory manager really does not like large objects. I'd recommend to cut your block into ten chuncks. If you have to stream it to a memorystream, then at least allocate it once and with the correct size - otherwise it may need be reallocated and cause fragmentation.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thx guys for your replys.
I went with the solution of cutting the objects into chuncks
|
|
|
|
|
You're welcome
|
|
|
|
|
I used SMTP class for sending mail but I have problem regarding sending a mail.
when we start anti-virus then i got a error Failure sending mail but when we disable the anti-virus then SMTP work properly.
Please help what we do when anti- virus still enable.
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Please, edit your question and provide better information.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Check your anti-virus settings.
|
|
|
|