|
I'm trying to create certificates through programatically and created a batch file as below
cd c:\Program Files\Microsoft Visual Studio 9.0\VC
makecert -ss CBBC
Note:CBBC is the certificate name, I'm using Visual studio 2008
When I tried to execute this batch file through programatically, it displayed the below message in command window.
"'makecert' is not recognized as an internal or external command, operable program or batch file."
When I tried manually, its creating certificate successfully. Please let me know the solution.
|
|
|
|
|
Include the path to the MakeCert application. If it can't find the command, you'll get the error that you described. The easiest way is to enhance/copy the batchfile that's used for the "Visual Studio 2005 Command Prompt" - look under the Start menu, under the "Microsoft Visual Studio 2005" folder; it has a Tools-folder, and it should have a link to said batchfile. That should also contain the commands to set the correct search-paths, so that it includes the commands for Visual Studio in your command prompt.
I are Troll
|
|
|
|
|
oh I see, I thought he was using CD to goto the correct directory for makecert
mine is C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\makecert.exe (if that helps anyone)
Don't vote my posts down just because you don't understand them - if you lack the superior intelligence that I possess then simply walk away
|
|
|
|
|
musefan wrote: I thought he was using CD to goto the correct directory for makecert
Remembering to change the directory would be the easiest way to solve it
I are Troll
|
|
|
|
|
do you need to use START (or something like that) before the program name
cd c:\Program Files\Microsoft Visual Studio 9.0\VC
START makecert -ss CBBC
EDIT:
it seems the problem is more likely the location of the makecert file (which is not in the CD directory as I assumed was being done)
correct version may look something like...
cd "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin"
makecert -ss CBBC
OR
cd c:\Program Files\Microsoft Visual Studio 9.0\VC
START /D"C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\" makecert.exe -ss CBBC
Don't vote my posts down just because you don't understand them - if you lack the superior intelligence that I possess then simply walk away
modified on Thursday, March 3, 2011 6:42 AM
|
|
|
|
|
cd "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin"
makecert -ss CBBC
it worked. Thank you...
I found there is a default certificate(Joe's-Software-Emporium) in CBBC Folder. How can I delete this default one. Thank you in advance
modified on Thursday, March 3, 2011 7:12 AM
|
|
|
|
|
I am using below code from below link:
using System.Globalization;
using System.Text.RegularExpressions;
string strValue= "0932;093E;0926;0947;0928;";
Regex rgexp = new Regex(@"([0-9A-Fa-f]{4});");
string strResult= rgexp .Replace(strValue, match => ((char)Int32.Parse(match.Groups[1].Value, NumberStyles.HexNumber)).ToString());
Response.Write(strResult);
Source:http://www.dotnetspider.com/resources/39073-How-convert-hindi-using-unicode.aspx
But there is red line with match = "> (Here it is showing red line)"
I am going to convert a Unicode String to Hindi (Indian Language). I am using VS 2005 Prof Edition.
Thanks.
|
|
|
|
|
I think your syntax may be incorrect (looks like LINQ), see here[^] for a sample of the Replace() method.
I must get a clever new signature for 2011.
|
|
|
|
|
and what is the error message that it shows..?
|
|
|
|
|
Thanks for your reply. Here it is the code:
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
string strValue= "0932;093E;0926;0947;0928;";<br />
Regex rgexp = new Regex(@"([0-9A-Fa-f]{4});");<br />
string strResult= rgexp.Replace(strValue, match => ((char)Int32.Parse(match.Groups[1].Value, NumberStyles.HexNumber)).ToString());<br />
textBox1.Text=strResult;<br />
}<br />
And the error :
Invalid expression term '>'
Even i am not able to resolve the issue from link given by first user please.
Thank you.
|
|
|
|
|
If I copy that code, then it works fine for me.
If you are getting an error around the => part (known as lambda expression[^]) then perhaps you are not using the correct version of .Net required to do this which is .Net 3.5 or above (I think)
EDIT
Change target framework[^] (VS 2008 but I am sure you will work it out for 2005)
...if version 3.5 or higher is not available then you will most likely need to install it first
CORRECTION
...actually you will need to get a copy of VS 2008 or VS 2010 if you want to use .Net 3.5 or higher
Don't vote my posts down just because you don't understand them - if you lack the superior intelligence that I possess then simply walk away
modified on Thursday, March 3, 2011 5:53 AM
|
|
|
|
|
VS2005 only supports the 2.0 framework. He'd have to compile by hand if he's going to use 3.0, or download VS2k8 Express
I are Troll
|
|
|
|
|
...you may have your knowledge, but at least I have my youth!
I see[^], exactly for the same reason why the OP is having the problem
Don't vote my posts down just because you don't understand them - if you lack the superior intelligence that I possess then simply walk away
|
|
|
|
|
Girish481 wrote: Unicode String to Hindi
Could you explain that? AFAIK, Unicode supports all characters. You're going to save it as ANSI with a Hindi-codepage?
What are you trying to achieve?
Girish481 wrote: I am using VS 2005 Prof Edition.
Would be .NET 2.0, and that doesn't support Lambda-statements. You'll have to convert it to a real method, or upgrade to a newer version of .NET.
I are Troll
|
|
|
|
|
If it is due to older framework version; then i will test the code on another machine and will post the output/error (if any).
Thank you very much for your replies.
|
|
|
|
|
As Eddy has said, you need to use a newer version of VS (i.e. 2008 or 2010) in order for the compiler to accept the lambda expressions. It is not just the installed version that is required
Don't vote my posts down just because you don't understand them - if you lack the superior intelligence that I possess then simply walk away
|
|
|
|
|
>What are you trying to achieve?
Actually i have got couple of files named like file1.txt, file2.txt etc... and these files are having unicode data too. I have to store these files data into databases like Oracle, SQL Server. So, i was in search to first convert a unicode string to convert it into editable text; i.e. something like :
Unicode String is "This is a unicode string" and i wish :
New String is : "Something text after conversion"; and then if i select hindi (an Indian Language) font for new string; it will show me the original string as it was in Unicode.
Now, here i do'nt know how do i know the complete steps to convert these files into that format; so that i can store those data into databases.
Thank you.
|
|
|
|
|
Girish481 wrote: I have to store these files data into databases like Oracle, SQL Server. So, i was in search to first convert a unicode string to convert it into editable text; i.e. something like :
Every string in .NET is in Unicode, it's the default nowadays. Meaning that you only need to read the text and pass it on to your database. Do make sure that your database also stores them in that format.
Girish481 wrote: Unicode String is "This is a unicode string" and i wish : New String is : "Something text after conversion";
That doesn't make sense. Unicode contains Hindi-characters - what would you want to convert them into?
Girish481 wrote: and then if i select hindi (an Indian Language) font for new string; it will show me the original string as it was in Unicode.
Both show the original string in the same encoding, only with different fonts. Some fonts are designed for use with ANSI and a specfic codepage, others were created for unicode[^]. Your string in Hindi should look allright when displayed as unicode in one of those fonts.
I are Troll
|
|
|
|
|
I am sorry for being late reply.
Probably i am not able to explain my need. See, whatever you have said, that is fine that if i says dim x as string="Hindi Words"; they are visible in the dotnet; but i want to convert them into "editable text", wish to apply some sort of font displays like bold, italic, color change etc. so, that i can say select * from mytable where name like '%Some Search String based upon Hindi words..%'. Here issue is that they are visible in IDE and Textboxes; but how do i give select criteria in the textbox so that database can see the query as mentioned above please.
Please let me know :
1.How do i convert Unicode Text to Edibable Text?
2.It would be more helpful if you please show me some code in action.
@ the moment; i am reading below link... but Ouch...it is also returning error....
Please scorll down and read the reply posted by Atul Bari...
http://nishantpant.wordpress.com/2007/01/04/how-to-convertdisplay-a-unicode-string-in-vbnet/
and the SQL Server Error is :
Msg 102, Level 15, State 1, Procedure Hex, Line 11
Incorrect syntax near '‘'.
Msg 102, Level 15, State 1, Procedure Hex, Line 20
Incorrect syntax near '‘'.
Msg 102, Level 15, State 1, Procedure Hex, Line 29
Incorrect syntax near '‘'.
Msg 102, Level 15, State 1, Procedure Hex, Line 38
Incorrect syntax near '‘'.
Msg 102, Level 15, State 1, Procedure Hex, Line 52
Incorrect syntax near 'end'.
Thank you very much for your continue support.
|
|
|
|
|
Girish481 wrote: Probably i am not able to explain my need
No worries; text-encoding is a though subject and I'm not very good at explaining either.
Girish481 wrote: . See, whatever you have said, that is fine that if i says dim x as string="Hindi Words"; they are visible in the dotnet;
Strings in .NET are in Unicode, in UTF8 to be precise. (UTF7, 8, 16 and 32 are all Unicode-formats), but Windows was around long before .NET - not everything is prepared for multibyte-characters. As a test, you can create a new project in Visual Studio and replace the code from Form1 with this code;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
public partial class Form1 : Form
{
const String ओम् = "ॐ (that's Ohm)";
TextBox myTextBox;
RichTextBox myRichBox;
public Form1()
{
InitializeComponent();
myTextBox = new TextBox();
myTextBox.Dock = DockStyle.Top;
myTextBox.Text = ओम्;
this.Controls.Add(myTextBox);
myRichBox = new RichTextBox();
myRichBox.Dock = DockStyle.Top;
myRichBox.Text = ओम्;
this.Controls.Add(myRichBox);
String cs = "Server=.;Database=Northwind;Trusted_Connection=True;";
using (SqlConnection con = new SqlConnection(cs))
using (SqlCommand cmd = con.CreateCommand())
{
cmd.CommandText = "UPDATE Customers SET CompanyName = @what WHERE ContactName = @ContactName";
cmd.Parameters.AddWithValue("ContactName", "Antonio Moreno");
cmd.Parameters.AddWithValue("what", ओम्);
con.Open();
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
cmd.CommandText = "SELECT CompanyName + '.' + ContactName FROM Customers WHERE CompanyName LIKE @bla";
cmd.Parameters.AddWithValue("bla", "%ॐ%");
string result = cmd.ExecuteScalar().ToString();
myTextBox.Text = result;
myRichBox.Text = result;
}
}
} Visual Studio should complain that you're using non-standard characters and it should propose to save it in a "universal" format - that's going to be Unicode again. If you have the Nortwind-database installed than you can execute this code as is, otherwise you'll have to change the table-names.
If all is well, it'd update a record in that database and search that record again - displaying the result in both textboxes.
Girish481 wrote: 1.How do i convert Unicode Text to Edibable Text?
As the example shows, Unicode is editable. Not every control understands unicode, which might be the reason why your seeing blocks (or question marks) in certain controls. It should also be noted that most databases expect ASCII/ANSI for text-fields, having special fields for multibyte-character sets. In Sql Server, that'd be the datatypes that are prefixed with an 'N', like NVARCHAR .
Girish481 wrote: and the SQL Server Error is :
Are you concatenating the parameter to the command (like "SELECT " + textbox1.Text) or are you using a SqlParameter to fill in the parameters of the query?
Hope this gets you going in the right direction
I are Troll
|
|
|
|
|
First i really wish to heartly thank to you for your continue support.
Thats a really very good, clear and helpful reply for me; but still issues are there:
1.How do i give/type Unicode in the textbox, something like :
Select * from mytable where name like '%ओम%' (Here i am copying from your reply)
I think if any how i am able to convert this ओम into "vkse" then it is how i wish to store the data in the table. Here "vkse" is the hindi translation of ओम if i select any Hindi font please;
or if you still feel that i am not explaning my need properly; please contact at my mail id i.e. gksharmaajmer@gmail.com
Thank you.
|
|
|
|
|
Girish481 wrote: First i really wish to heartly thank to you for your continue support.
You're welcome
Girish481 wrote: 1.How do i give/type Unicode in the textbox, something like : Select * from mytable where name like '%ओम%' (Here i am copying from your reply)
There's a catch there, in the Sql part. If you execute that statement in Sql Server Management Studio Express (or any other Query-tool) than you'll find 0 records. The statement below should work, but..
SELECT * FROM mytable WHERE name LIKE N'%ओम%' There's another caveat, with the .AddWithValue method on the SqlCommand class; somehow it finds 0 records again. Long story short, a bit (working) code with a workaround;
public partial class Form1 : Form
{
const String Ohm = "ओम्";
RichTextBox myRichBox;
public Form1()
{
InitializeComponent();
myRichBox = new RichTextBox();
myRichBox.Dock = DockStyle.Top;
myRichBox.Text = "ओ";
this.Controls.Add(myRichBox);
using (SqlConnection con = new SqlConnection(
"Server=.;Database=AdventureWorks;Trusted_Connection=True;"))
using (SqlCommand cmd = con.CreateCommand())
{
cmd.CommandText =
"UPDATE Person.Contact SET FirstName = @what WHERE ContactID = @ContactID";
cmd.Parameters.AddWithValue("ContactID", 25);
cmd.Parameters.AddWithValue("what", "O" + Ohm);
con.Open();
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
cmd.CommandText =
"SELECT ContactID FROM Person.Contact WHERE FirstName LIKE N'%@what%'";
cmd.CommandText = cmd.CommandText.Replace("@what", myRichBox.Text);
string result = cmd.ExecuteScalar().ToString();
myRichBox.Text = "Found record @Id; " + result;
}
}
} I've used the AdventureWorks database here, but it should work equally with the Northwind database. This[^] page on MSDN has some lengthy explanation.
I are Troll
|
|
|
|
|
Even though i have not yet tried your code in my machine (VS 2010) because you are showing the code in a different approach, but my need/question is different. I agree that if i runs your code it will work fine if table is having Unicode Strings in the columns; but my question is "How i will give Unicode Strings in the Textbox to search the table" like :
select * from mytable where col1=Textbox1.Text (Here how do i supply Unicode in the Textbox).
Whereas, if i were able to store converted strings in the column then i think it is more flexible to handle the data, because now it is converted and editable to any tool. Something like if table is having Unicode values then problem is how do i supply / search in the table using textbox1 and then populate my FlexGrid.
I think its going a larger thread on the forum, thats why i gave you my mail id; so that if i gets the final and the complete answer; then i will post your code here; so that other user of the forum may get handy answer as well.
Best Regards.
|
|
|
|
|
Girish481 wrote: Something like if table is having Unicode values then problem is how do i supply / search in the table using textbox1 and then populate my FlexGrid.
Searching is done using the LIKE operator as shown. Giving the user an easy way to enter values would be harder; some languages would require their own IME-editor[^].
If the keyboard can't supply all characters, then you'll need one of those.
I are Troll
|
|
|
|
|
Hi
One question - is it impossible to safe guard an application hosting third party dll?
See this thread, even if third party dll loaded into separate AppDomain, it can still access AppDomain.Current.Get/SetData[^]
In addition to AppDomain.Current.Get/SetData, can third party examine application memory. For example, hosting application may contain a secret/private key in some application context, which is used to decrypt communications or licensing file. Even if private key is not placed in AppDomain.Current.Get/SetData, is it possible for third party dll to ... perhaps "reflect" on the process memory foot print and extract the private key?
If the answer is yes - then it follows really the moment you load a third party dll into your own process, you cannot be sure if your process has been compromised?
I think security is even more important than say process isolation safe guarding against crashes in third party dll.
Thanks
NOTE: This is NOT a question on CAS[^] as setting permissions/evidence doesn't has anything to do with access to AppDomain from third party dll[^]
Also, this is not a question on serializing access to a singleton instance object[^]
dev
modified on Thursday, March 3, 2011 5:41 AM
|
|
|
|
|