|
When list view is in large icon mode the selection of the item highlights the item text but also the thumbnail image becomes grayish or bluish.
How to avoid thumbnail image to tarnish when selected?
Чесноков
|
|
|
|
|
The only way I know of is by painting the items yourself, see OwnerDraw property and DrawItem event.
|
|
|
|
|
I have a sqlite file with me... I want to provide encryption for that file. Can some body let me know how to provide encryption for the db files(other than password) so that i will be full secured and decrypted back.
Can it be possible with streams or is there any other techniques to encrypt, Please let me know... Thanks in Advance..
|
|
|
|
|
There seems to be plenty of information here[^], a well covered subject
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'm going to be creating a series of DLL's. I don't want a programmer to be able to use them unless they have a registration file in place.
What's the best way to do this?
Everything makes sense in someone's mind
|
|
|
|
|
They are many licensing mechanisms available, both free and paid. Have you done at least a cursory search?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yes a bit. But I'm not really sure what to look for. Never done this before.
Everything makes sense in someone's mind
|
|
|
|
|
Provide the registration file with the DLL or as an embedded resource.
|
|
|
|
|
I considered that, but then I would have to recompile the DLL for each client.
Everything makes sense in someone's mind
|
|
|
|
|
No you wouldn't. Everyone can use the same one.
|
|
|
|
|
FYI, there have been threads in the C# forum for how to dynamically inject a resource into a DLL. I forget the exact approach, but I participated in just such a thread, so I know there's an answer here somewhere if that's what you want to do.
|
|
|
|
|
you may want to look at this thread[^]. Without any guarantee!
|
|
|
|
|
I've been trying to figure this out for over an hour and haven't had any luck. While doing a string comparison, this works but is case sensitive ... I'd like to make it case insensitive, any ideas on how to do this?
while ((line = file.ReadLine()) != null)
{
if (line.Contains(searchString))
{
textBox12.Text += "Line Number " + counter.ToString() + ":" + "\r\n";
textBox12.Text += line + "\r\n";
textBox12.Text += "\r\n";
}
counter++;
}
Complete function
if (checkBox1.Checked == false)
{
foreach (string i in xmlFileNames)
{
FileStream fs = new FileStream(@i, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
StreamReader xmlStream = new StreamReader(@i);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(fs);
string allRead = xmlStream.ReadToEnd();
string line = null;
int counter = 0;
string testString = Regex.Match(allRead, searchString, RegexOptions.IgnoreCase).ToString();
if(Regex.Match(allRead, searchString, RegexOptions.IgnoreCase).Success == true)
{
System.IO.StreamReader file = new System.IO.StreamReader(@i);
while ((line = file.ReadLine()) != null)
{
if (line.Contains(searchString))
{
textBox12.Text += "Line Number " + counter.ToString() + ":" + "\r\n";
textBox12.Text += line + "\r\n";
textBox12.Text += "\r\n";
}
counter++;
}
}
xmlStream.Close();
}
textBox12.AppendText("Number of xmls listed: " + xmlFileNames.Count().ToString());
}
|
|
|
|
|
Unfortunately, the Contains method does not support any of the StringComparison overloads that othr methods do.
The workaround is to use IndexOf which does:
if(line.IndexOf(searchString, StringComparison.OrdinalIgnoreCase) >= 0)
{
...
}
|
|
|
|
|
That worked well, thank you
|
|
|
|
|
|
Bad idea when working with non-Latin General char sets.
|
|
|
|
|
I know, but most people would have used it and moved on. And maybe sought/asked for a better solution later.
|
|
|
|
|
First define an IEqualityComparer like this:
class CharEqualityComparer : IEqualityComparer<Char>
{
bool ignoreCase;
pubilc CharEqualityComparer(bool ignoreCase)
{
this.ignoreCase = ignoreCase;
}
pubilc CharEqualityComparer() : this(false);
{
}
public bool Equals(Char c1, Char c2)
{
c1 = (ignoreCase) ? c1.ToString().ToLower().ToCharArray()[0] : c1;
c2 = (ignoreCase) ? c2.ToString().ToLower().ToCharArray()[0] : c2;
if (c1 == c2)
{
return true;
}
else
{
return false;
}
}
public int GetHashCode(Char c)
{
int hCode = (int)c;
return hCode.GetHashCode();
}
}
and then do this in your code
if (line.Contains(searchString, new CharEqualityComparer(true)))
Hope this helps!
Cheers
Manfred
|
|
|
|
|
That looks correct but expensive, as each pair of characters may result in the creation of several string objects.
The community content on MSDN[^] suggests another approach.
|
|
|
|
|
Just to enhance upon this solution, instead of doing a ToUpper/ToLower, you can use String.Equals with a StringComparison overload:
public bool Equals(Char c1, Char c2)
{
var comparison = (ignoreCase) ? StringComparison.OridinalIgnoreCase : ? StringComparison.Oridinal;
return String.Equals(c1.ToString(),c2.ToString(),comparison);
}
|
|
|
|
|
Thanks for that info!
Cheers
Manfred
|
|
|
|
|
Write an extension method that overloads the string.Contains() method.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi
I need to play(render) a video stream from an IP camera. Since media element does not support rtsp protocol, I created a rtsp client which connects to the camera. Now I am not sure what to do with that stream? My best guess is to save it file, and than use media player to render it. Does anybody knows how to do that? What I am concerned is, when to delete old data from the file and how can the same file be opened for reading and writing at the same time? If anybody has any ideas how to solve those problems, please let me know.
Uroš
|
|
|
|
|