|
Dear Graus
Regards!
i need the drawing editor just like the one available on the link
www.codeproject.com/useritems/DrawToolsRedux.asp
in C# and OpenGl.means programming of all the Drawing Editor in C# u sing OpenGl.
Thanking n advance.
Regrds
David
david
|
|
|
|
|
|
I have the following:
DataGrid dgSubdivisions
TextBox addName
TextBox addCity
TextBox addState
The textboxes are all in a Footer of the DataGrid, the datagrid fills itself using all TemplateColumns and a SQL Database.
I am working on the add (insert) piece of the database. I can't figure out how to get the values of the textboxes to insert them into the database.
Here is what I have, no errors, although no inserted data.
cmd.Parameters.AddWithValue("@Name", ((TextBox)dgSubdivisions.Controls[0].Controls[indexFooter].FindControl("addName")).Text);<br />
cmd.Parameters.AddWithValue("@City", ((TextBox)dgSubdivisions.Controls[0].Controls[indexFooter].FindControl("addCity")).Text);<br />
cmd.Parameters.AddWithValue("@State", ((TextBox)dgSubdivisions.Controls[0].Controls[indexFooter].FindControl("addState")).Text);<br />
cmd.Parameters.AddWithValue("@ZIP", ((TextBox)dgSubdivisions.Controls[0].Controls[indexFooter].FindControl("addZIP")).Text);<br />
cmd.Parameters.AddWithValue("@Parcel", ((TextBox)dgSubdivisions.Controls[0].Controls[indexFooter].FindControl("addParcel")).Text);
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
I want to synchronize my system clock timing with the NIST timing through program. how can i get the NIST timimg
Please Give me a suggestion or a reference site
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
The NTPClient class is simply to use. Follow the example below:
NTPClient client;<br />
try<br />
{<br />
client = new NTPClient("time.nist.gov");<br />
client.Connect();<br />
}<br />
catch(Exception e)<br />
{<br />
Console.WriteLine("ERROR: {0}", e.Message);<br />
return;<br />
}<br />
Console.Write(client.ToString());<br />
Regards,
Satips.
|
|
|
|
|
|
I have put that NTPCLient in my application . I have mentioned it for example. Likewsie She can put it for her Namespace.
Regards,
Satips.
|
|
|
|
|
Thank you Thank you Thank you a lot.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Welcome
Regards,
Satips.
|
|
|
|
|
Dear Satips,
If i am enabling the windows time service then it will automatically synchronize my system time know.
If yes, then is it possible for me to enable this service from the server itself.
Can i manipulate the clients' services
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
While this may not be best practice, it's experimental in my attempts to learn regex while playing around with a RichTextBox.
The idea is to find all HTML tags and color them. However, it's not behaving well. It does indeed find tags such as <html> or </html>, but not <body bgcolor="#ffffff">. I'm relatively sure I have the Regular Expression correct.
Another strange behavior is it won't let me edit the colored tags once they have been "colorized".
I'm triggering this with a key press event (Enter).
At this point, I'm open to suggestions to make this work as prescribed, and of course, I'm prepared to hear alternative suggestions to get the results I'm looking for.
Thank you...
private void ChangeTagColors(RichTextBox richTextBox1)
{
richTextBox1.SelectionStart = 0;
richTextBox1.SelectionLength = richTextBox1.Text.Length;
int index = 0;
foreach (string str in richTextBox1.Text.Split())
{
Regex regex = new Regex(
@"(\<[^\>]*\>)",
RegexOptions.IgnoreCase
| RegexOptions.Multiline
| RegexOptions.Singleline
| RegexOptions.ExplicitCapture
| RegexOptions.Compiled
);
if (regex.IsMatch(str))
{
richTextBox1.SelectionColor = Color.Blue;
richTextBox1.SelectionProtected = true;
}
index = index + str.Length + 1;
}
}
|
|
|
|
|
Hello,
simplicitylabs wrote: but not
Maybe it's because of the " chars, try:
You also could simplify your regex like this:
@"(\<.*\>)"
Apart from that I would suggest you to use the String class methods for this kind of simple validation (IndexOf).
I now that regex is extremely powerfull, but it's also very expensive in terms of perfomance.
Shortly I made a performance test because I had to validate a lot of strings very often in my application.
I found out that using 3 IndexOf instead of a regex was much faster (more than 100 times faster).
simplicitylabs wrote: Another strange behavior is it won't let me edit the colored tags once they have been "colorized".
I think it's not strange at all, as you are explicitly forcing it with: richTextBox1.SelectionProtected = true;
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hi Guys,
Just want to ask few questions:
1. how to end user's login session if the user is disconnected from the internet?
2. in C#, what events i suppose to apply if i want to run some function when the users close the "X" button on the Browser?
Thanks a lot
|
|
|
|
|
Is this a Web Forms app or Windows Forms?
|
|
|
|
|
Sorry for the late reply, it's a web-apps ... running on IIS ...
|
|
|
|
|
There is no way for the server to know when the user closes his/her browser. There is no event that's raised, no communication, no nothing. You just have to wait for the session to timeout, which IIRC, is 20 minutes by default.
|
|
|
|
|
I'm new with C#
Need to figure out a way to assemble Serial Port partial reads (packets) to an XML document.
Managed to assemble complete XML string (), but XmlReader takes Stream or the file path as an input.
Appreciate any help.
sklepikov
|
|
|
|
|
You need XmlDomDocument, or XmlDocument. Or you need to pass the string into a memorystream.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Can I use SerialPort.BaseStream?
When it get flushed?
|
|
|
|
|
I just want to add X509Certificate to store, and enable user to read it's private key. I snatched part of code from here but it won't work.
<br />
private static void PlaceInStore(X509Certificate2 cert)<br />
{<br />
X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);<br />
<br />
try<br />
{<br />
store.Open(OpenFlags.ReadWrite);<br />
<br />
using (RSACryptoServiceProvider csp = cert.PrivateKey as RSACryptoServiceProvider)<br />
{<br />
CspKeyContainerInfo kci = csp.CspKeyContainerInfo;<br />
CryptoKeySecurity cks = kci.CryptoKeySecurity;<br />
<br />
cks.SetAccessRule(new CryptoKeyAccessRule("ARCHITECT\\testuser",<br />
CryptoKeyRights.FullControl, AccessControlType.Allow));<br />
}<br />
<br />
if (!store.Certificates.Contains(cert))<br />
store.Add(cert);<br />
}<br />
finally<br />
{<br />
store.Close();<br />
}<br />
}<br />
Help anyone?
|
|
|
|
|
I once had to do a similar thing - adding a certificate to a particular certificate store.
And I discovered something very strange:
Nothing happened if I used the Add method, but if instead I used the AddRange method it worked. AddRange takes as parameter a collection of certificates. Just create a new collection, add your certificate to it and call AddRange. And never lose your hope.
|
|
|
|
|
Dunno... Add method works great for me. Anyways I found some kind of solution googling, it works, but I don't like it. Anyways, if someone has better solution please post, until then I'll use this:
private static void PlaceInStore(X509Certificate2 cert)
{
X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
try
{
store.Open(OpenFlags.ReadWrite);
if (!store.Certificates.Contains(cert))
store.Add(cert);
int indexInStore = store.Certificates.IndexOf(cert);
cert = store.Certificates[indexInStore];
AddAccessToCertificate(cert, "ARCHITECT\\testuser");
}
finally
{
store.Close();
}
}
private static void AddAccessToCertificate(X509Certificate2 cert, string user)
{
RSACryptoServiceProvider rsa = cert.PrivateKey as RSACryptoServiceProvider;
if (rsa != null)
{
string keyfilepath =
FindKeyLocation(rsa.CspKeyContainerInfo.UniqueKeyContainerName);
FileInfo file = new FileInfo(keyfilepath + "\\" +
rsa.CspKeyContainerInfo.UniqueKeyContainerName);
FileSecurity fs = file.GetAccessControl();
NTAccount account = new NTAccount(user);
fs.AddAccessRule(new FileSystemAccessRule(account,
FileSystemRights.FullControl, AccessControlType.Allow));
file.SetAccessControl(fs);
}
}
private static string FindKeyLocation(string keyFileName)
{
string text1 =
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
string text2 = text1 + @"\Microsoft\Crypto\RSA\MachineKeys";
string[] textArray1 = Directory.GetFiles(text2, keyFileName);
if (textArray1.Length > 0)
{
return text2;
}
string text3 =
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string text4 = text3 + @"\Microsoft\Crypto\RSA\";
textArray1 = Directory.GetDirectories(text4);
if (textArray1.Length > 0)
{
foreach (string text5 in textArray1)
{
textArray1 = Directory.GetFiles(text5, keyFileName);
if (textArray1.Length != 0)
{
return text5;
}
}
}
return "Private key exists but is not accessible";
}
|
|
|
|
|
Hi Mikker,
I know its been a longgggggggggggggggggggggg time since you have replied to this post but I bumped into your post and I wanna do exactly what you have mentioned...but the problem I am facing is that I am confused as to how to call the PlaceInStore() function ? I tried using HTTPHandlers in WCF service but it didnt work so I am kinda stuck now.
Pleas help ?? Anybody???
Naeem
|
|
|
|
|
How can we work if we have to access the remote server certificates.
For remote server it is showing an exception keyset not found
Thanks in Advance. Please enlighten me
modified 7-May-18 9:32am.
|
|
|
|
|
Hello everybody!
I've a trouble and I can't solve
I've a PC with a local login/password shared folder and I need authenticate this user across winforms application to write a xml file.
The question is, how do I authenticate this user?
This user doesn't in AD group (is just a local user in machine).I need to do authentication manually.
Somebody knows?
Tks 4all!
|
|
|
|