|
Hi,
Thanks. Your reply helped me a lot. One more thing I would like to ask here. I have a textbox in which let say I enter pooja.katiyar...this is my sAMAccountName. but when I click on the search button how can I get the property name for that particular value?
Actually I am trying to build a filter. In my UI I have a textbox and button. Whatever I enter in the textbox and click on the button, it should be able to find that record if it exists!
Thanks.
Pooja.
|
|
|
|
|
Hello All!!
I have created a windows service and the problem is when I log off my system account in which the service is currently running, the service stops. Why is this so? I want my service to run independent of my system account.
Thanx in advance
regards
Mubashir
Storan Technologies (USA)
|
|
|
|
|
Is it a real windows service?
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
-- modified at 10:42 Friday 9th June, 2006
|
|
|
|
|
How can i edit a ListViewSubItem in ListView control in C#.
I have set the View property of ListView Control to View.Details.
I set the LabelEdit property to true but it only lets editing 0th index listviewsubitem.
Thanks
|
|
|
|
|
System.Windows.Forms.ListView does not support that.
Try the article search for "editable list view".
_________________________________
Please inform me about my English mistakes, as I'm still trying to learn your language!
|
|
|
|
|
Is SqlCommand object can contain more then one outputparameters.
if say yes, how can i get the output value.
|
|
|
|
|
maaran wrote: Is SqlCommand object can contain more then one outputparameters.
Yes, it can contain more than one output parameter
maaran wrote: how can i get the output value
By asking each SqlParameter for its Value after the SqlCommand has been executed.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
can you give one simple sample with two output parameter
|
|
|
|
|
Not complete, but it should give you enough to work with:
SqlParameter p1, p2;
p1 = new SqlParameter( ... );
p1.Direction = ParameterDirection.Output;
p2 = new SqlParameter( ... );
p2.Direction = ParameterDirection.Output;
theCommand.Parameters.Add(p1);
theCommand.Parameters.Add(p2);
theCommand.Execute( ... );
firstValue = p1.Value;
secondValue = p2.Value;
---
b { font-weight: normal; }
|
|
|
|
|
I wrote a class named Region, which encapsulates the content of a part of the screen.
Region keeps two Bitmap objects: content, and lastContent,
and it compares them via this code:
private void checkForChange()
{
for (int y = 0; y < bounds.Height; y += 10)
for (int x = 0; x < bounds.Width; x += 10)
if (content.GetPixel(x, y) != lastContent.GetPixel(x, y))
{
userCallBack(this);
return;
}
} In the main program, I have an array of Region object, each representing a different part of the screen.
I use a new thread for each region check, and when a check is finished, I reactivate it.
However, this consumes a great deal of CPU.
Task Manager shows between 15 to 25 CPU usage.
Any ideas regarding how to decrease the CPU usage (not at the algorithm level)?
Thanks,
Shy.
|
|
|
|
|
You could set the priority (something like ThreadPriority on the Thread class) of the thread lower.
Other then this using GetPixel is rather slow. Have a look at this[^] article series on how to do it faster.
|
|
|
|
|
Thanks! Looks good!
I'll get right on to it, and come back here with my future questions
Thanks again!
|
|
|
|
|
Well...
I tried using pointers like the article described...
Didn't help much...
This is my new code:
private void checkForChange()
{
Rectangle r = new Rectangle(0, 0, bounds.Width, bounds.Height);
BitmapData dataContent = content.LockBits(r, ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
BitmapData dataLast = lastContent.LockBits(r, ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
int stride = dataContent.Stride;
int offset = stride - dataContent.Width * 3;
int width = dataContent.Width * 3;
int height = dataContent.Height;
unsafe
{
byte* pContent = (byte*)dataContent.Scan0;
byte* pLast = (byte*)dataLast.Scan0;
for (int y = 0; y < height; ++y, pContent += offset, pLast += offset)
for (int x = 0; x < width; x += 3, pContent += 3, pLast += 3)
if (pContent[0] != pLast[0] || pContent[1] != pLast[1] || pContent[2] != pLast[2])
goto Found;
}
Cleanup:
content.UnlockBits(dataContent);
lastContent.UnlockBits(dataLast);
return;
Found:
userCallBack(this);
goto Cleanup;
} It even uses more CPU...
Ideas?
|
|
|
|
|
Hello all,
in my Win Applicaiton. i am using TabControl. In this I added 2 Tabs. I want to disable second tab. It is not having Enabled Property.
How to do this
any sounds will be appriciated
regards
GV Ramana
|
|
|
|
|
TabPages have the Enabled property
TabControl1.TabPages(1).Enabled = False
|
|
|
|
|
Is that possible to Program the tab control's button, which appears on the top and are associated with the tab pages?
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
If you want to do this at runtime(which it sounds like you do), all you need to do is set TabControl.Tabpages[].Enabled = false. If you want to do it upon changing tabs, you can handle the TabControl.TabIndexChanged event or any of many other TabControl Events[^].
|
|
|
|
|
How can i edit a listviewsubedit in ListView control in C#.
I have set the View property of ListView Control to View.Details.
I set the LabelEdit property to true but it only lets editing 0th index listviewsubitem.
Thanks
|
|
|
|
|
peshawarcoder wrote: How can i edit a listviewsubedit in ListView control in C#
You can't
Have a search on CodeProject for "editable ListView", results 1 and 3 might be what you're after.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Jesal Rana wrote: I want to know the method or any help to change the fonts of website to the different fonts
This question makes no sense whatsoever!
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Hi All,
I am developing a search engine and i m using "." as a seperator of a token..... but now i have to search URLs as well so anyone plz tell me how can i realize that a particular string is a URL.....
looking forward for help
Regards,
|
|
|
|
|
Have a look through regexlib[^] and you'll probably find several ones. Another one is the RegularExpressionValidtorControl in ASP.NET has some built in ones, it may be in there.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Sir i want to do this using C# and want to know about the RegularExpression class of C#....
any help in this regard will b welcomed
looking forward for help
Regards,
|
|
|
|
|
Rizwan Rathore wrote: want to know about the RegularExpression class of C#
Best place is the documentation provided by MSDN[^]
Ok basically you want the System.Text.RegularExpression namespace, the most important class is RegEx which handles all the matching etc. There is a constructor for this class which takes the regular expression pattern (for the URL in this case) and creates a RegEx object based on it. If you then want to check for URLs you can use:
IsMatch - Checks if a string, or part of the string specified in the parameters matches the regular expression provided in the constructor.Match - Returns a match object which contains the first match that the class found matching the regular expression.Matches - Returns a collection of Match objects for each regular expression matched correctly. If the regular expression is enclosed in parentheses then the url can be extracted by using the Group collection.
Example: This simple code will extract all the urls from a given string.
string urls = "there is a url included somewhere in this string : http://www.codeproject.com/script/comments/forums.asp?msg=1524600&forumid=1649#xx1524600xx and here is another url http://regexlib.com/Search.aspx?k=uri";
string urlRegex = @"(?<url>(mailto\:|(news|(ht|f)tp(s?))\://){1}\S+)";
Regex regex = new Regex(urlRegex);
foreach (Match m in regex.Matches(urls))
{
Console.WriteLine(m.Groups["url"].Value);
}
Console.ReadLine();
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hi Sir,
thats exactly wat i need but when i tried the program i got this exception
An unhandled exception of type 'System.ArgumentException' occurred in system.dll
Additional information: parsing "(?<url>(mailto\(news|(ht|f)tp(s?))\://){1}\S+)" - Too many )'s.
at this instruction
string urlRegex = @"(?<url>(mailto\(news|(ht|f)tp(s?))\://){1}\S+)";
now i am totally new commer in C# so plzz tell me how can i correct this i am writing the same code which u sent...
so plzz reply back soon
looking forward for help
Regards,
-- modified at 14:30 Friday 9th June, 2006
|
|
|
|