|
Ok, those are VT100 / VT220 terminal control sequences and then consist of ASCII characters:
ESC [ n ; n x Where:
ESC is Hex 1B
[ is [
n is a number, in ASCII digits: '0' (hex 30) to '9' (hex 39) repeated
; is ;
x is a command code which tells the terminal what to do Some parts are optional, and question marks can be included as well!
The command code is an ASCII character which (IIRC) will be upper or lower case 'a' to 'z'.
The command code tells the system what to do with the whole command: r is a "Set scrolling region" command, H is cursor positioning, and so forth.
(You can find out what they do here: http://epsfiles.intermec.com/eps_files/eps_man/977047037c.pdf[^] - section 8)
To remove them, you will have to parse the string yourself, and find the start and end of the sequence: it may be possible to do it with a regex, but I've never tried (And am not about to! )
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
A quick thought (it's amazing what else you can think of when in a boring meeting) gives me this regex:
\x1B\[\??\d+(;\d+)?[a-zA-Z] That with a regex Replace operation replacing with a empty string should get rid of them. Probably.
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
Thanks.... Its working 
|
|
|
|
|
You're welcome!
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
I run into the same problem and have figured out a workaround that works for as. It is not a perfect solution.
I use a regular expressions substituions between the TCP buffer and the Telnet protocol because the firmware sometimes use unknow esc sequnences that bother the telnet/terminal protocol.
I use Perl for switch automation but i try to translate it to C# (The orginal is a Perl module
Regexp::Common::ANSIescape ).
I use this expression
\x1BE/\n before the big one and this after
\[[0-9]+;[0-9]+H because the firmware use sometimes esc secuences that does not exist.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace ProcurevAnsiFilter {
class Program {
const string CHAR_STR = @"(.|\n)*?";
const string CSI_7BIT = @"\x1B\\\x5B";
const string CSI_8BIT = @"\x9B";
const string CSI_7OR8 = @"(?:" + CSI_7BIT + "|" + CSI_8BIT + ")";
const string C1_NST_8BIT = @"[\x80-\x8F\x91-\x97\x99\x9A\x9C]";
const string C1_NST_7BIT = @"\x1B[\x40-\x4F\x51-\x57\x59\x5A\\\x5C]";
const string C1_STR_7BIT = @"\x1B[\x5D\x50\x58\x5E\x5F]";
const string C1_STR_8BIT = @"[\x9D\x90\x98\x9E\x9F]";
const string C1_STR_7OR8 = @"(?:" + C1_STR_7BIT + "|" + C1_STR_8BIT + ")";
const string ST_7BIT = @"\x1B\\\\";
const string ST_8BIT = @"\x9C";
const string ST_7OR8 = @"(?:" + ST_7BIT + "|" + ST_8BIT + ")";
static void Main(string[] args) {
string[] tmp = new string[] {
@"(?:[\x30-\x3F]*)(?:[\x20-\x2F]*[\x40-\x7E])",
C1_NST_7BIT,
C1_NST_8BIT,
C1_STR_7OR8 + CHAR_STR + ST_7OR8
};
string regex = "(?:" + string.Join("|", tmp) + ")";
Regex reg = new Regex(regex);
}
}
}
|
|
|
|
|
Hi everyone,
i am using Visual Studio 2012 and Sql Server 2008 R2.
i am writing a program that is about inventory tracking.
All of my works is done.
it is working very well in Visual Studio.
And i have to create setup file.
i use installsheild 2013 LE.
I am constantly encountering errors in the setup file.
occurs difference with version of sql server which another computer and mine
and there are many errors about different case.
So let me know please, how i create setup file in this situation.
i want to automaticaly setup sql server,net frameworks and my project.
|
|
|
|
|
First, do NOT install SQL Server as part of your setup. Reason being is that MS doesn't license nor support doing that. SQL Server should be installed completely separately. This give admins the option of using their own SQL Server to host your app data instead of managing yet another instance of SQL Server.
|
|
|
|
|
Ok thanks. i handled net frameworks. i will install sql separately.
Do you know why occured difference between two computers sql versions?
my sql is sql server menagement studio 2008 R2 and other computer have Microsoft SQL Server 2008 Express SP1.
is that so?
|
|
|
|
|
You're not comparing the same thing. The first one is a tool used to manage SQL Server and can be used on multiple versions of SQL Server and the second is a database engine.
So, yes, it's possible to have both of those installed on the same machine.
|
|
|
|
|
i am creating a exe file using visual studio 2010, if i send it to my frnd who doesnt have visual studio, will it run over his system ??
|
|
|
|
|
Only if he has the .NET Framework version installed that your app targeted when you built it.
Open the Project Properties and look at the Application tab. In there you'll find a dropdown with the Target framework specified.
|
|
|
|
|
As you are using Visual Studio 2010, it's a simple matter for you to create an application installer - it's one of the project types. This will include the relevant .NET framework version as a prerequisite.
|
|
|
|
|
Shouldn't be any issue if you build the project using MSI Installer. You however need to create MSI Package Using a Visual Studio Setup Project and build/deploy from it. Include all the dependencies properly.
http://support.microsoft.com/kb/307353[^]
|
|
|
|
|
He needs the .Net framework which he can download and install for free.
make sure it is the correct version. (although I believe the latest ones will run the previous ones as well)
|
|
|
|
|
V. wrote: although I believe the latest ones will run the previous ones as well
Not so - the "complete backward compatibility" of .NET ended with V4.5, which won't run all earlier versions without changes: http://msdn.microsoft.com/en-us/library/ff602939(v=vs.110).aspx[^]
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
You should only need a configuration file change, though:
Backward compatibility and the .NET Framework 4.5:
The .NET Framework 4.5 and its point releases are backward-compatible with apps that were built with earlier versions of the .NET Framework.
In other words, apps and components built with previous versions will work without modification on the .NET Framework 4.5.
However, by default, apps run on the version of the common language runtime for which they were developed, so you may have to provide a configuration file to enable your app to run on the .NET Framework 4.5.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yep: but if you don;t realize that it can cause a lot of hair pulling!
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
Hi,
Just putting it out there.
Any one living on the Sunshine Coast, Qld, Australia, or nearby.
Who is willing to hire themselves out on an hourly basis to help me with C# / Ninjascript programming? I'd love to hear from you.
I have done a book based C# course and am able to code windows apps in Visual Studio but am having trouble with some of what I want to achieve in Ninja.
I have coded one indicator successfully. And am trying to create a more complex tool but am butting my head against a brick wall at present. I know I can hire someone on the internet to code it for me, but I prefer to learn how myself, because there is more I wish to do.
Ideally, an experienced coder to come to my house and spend an hour or two at a time with me would do the trick. Just to help me clear a few hurdles.
So hoping to hear from someone.
Ken.
|
|
|
|
|
Ok, Haven`t had any replies so would there be anyone further afield like Brisbane or Gold Coast, that would be willing to help?
|
|
|
|
|
You have chosen the wrong site. Codeproject.com is not meant for such stuff. Please don't post such messages/Questions/Answers anywhere on the site. We have very powerful reporting mechanism which may lead you to account cancellation.
"When you don't know what you're doing it's best to do it quickly"- SoMad
|
|
|
|
|
My site is working on QA and Dev server for IE9 but not for production server.
All the servers are windows 2012.
can anyone point what can be the probable cause?
|
|
|
|
|
I am not sure what, if anything, this has to do with C#, but you are asking people to make a guess based on no useful detail of your problem.
|
|
|
|
|
|
Yes. Your production setup is different to your QA and Dev setup. Beyond that, without any actual details of what isn't working, you're not likely to be able to get much more help.
BTW - this isn't really a C# question.
|
|
|
|
|
HI
I am getting an error "Cannot create an instance of the abstract class or interface Microsoft.Office.Interop.Excel.Application"
Please suggest.
code:
Microsoft.Office.Interop.Excel.Application ExcelObj = new Microsoft.Office.Interop.Excel.Application(); ExcelObj.DisplayAlerts = false;
if (ExcelObj == null)
{
return null;
}
|
|
|
|