|
Thank, So How to Take a pic when i right click on a control? And Convert it a text with OCR? what library should i use for it?
modified 10-Oct-16 1:57am.
|
|
|
|
|
Your link doesn't work and we are not a write code to order service.
|
|
|
|
|
In C# 2005, I did not find lineControl, Have I be installed the wrong ? I want to have control I install them like ?
|
|
|
|
|
What are you talking about? I have no idea which LineControl you are talking about: what namespace should it be in, what does it do, how are you trying to use it? What environment is your app supposed to run for?
Remember that we can't see your screen, access your HDD, or read your mind.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
If you mean in WinForms ...
- Add a Label control to your form.
- Set Label Text to empty.
- Set BorderStyle to Fixed3D.
- Set AutoSize to false.
- Set Height to 2 (most easily accomplished by typing 2 into the Size/Height field under Label Properties).
|
|
|
|
|
Hi,
I am totally new to ASP.NET. Please help me to create a project to store persistent data.
Thanks
|
|
|
|
|
And you call your self a "senior" developer
Decide where you want to store the data (database or file system)
For database read up on creating a Web API project that uses a data access layer to connect t a database.
For file system read up on system.IO
No matter how you store the data you are going to have to research on what you intend to do.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: And you call your self a "senior" developer
Presumably, a "Very Senior Developer" is the one who can use Google...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
sunsher wrote: help me
How can we help you? Do you need help with a simple google search? Do you need help finding the search capabilities of CodeProject? Maybe need help finding the sticky post describing how to ask a question?
|
|
|
|
|
If you want help you need to be much more specific. What do you mean by persistent data? In ASP.Net you can store data in the application cache which persists as long as the process is running. You can store in a cookie which persists until it expires or is deleted. You can persist in the database or a file for however long you want.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Yes.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
To store data, you need to use a database of some sort.
ASP.Net can connect to many databases.
|
|
|
|
|
Would XML file work that way? And is it possible to use CRUD with XML?
|
|
|
|
|
Yes and Yes
Use XML (file based storage) only if you have very limited data in a simple data structure AND the application is single user only.
File based data (XML) is notoriously difficult to manage when doing CRUD, you need to read the entire file, select the record you want to modify, change the record, reconstruct the file, write the entire file to the disk.
No multiuser, there is no concept of record locking.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Then what's the best method? Use XML or SQL database? Because I have to use CRUD.
|
|
|
|
|
Use SQL Server or LocalDB or SQL Lite, there are a number of databases available, I would use SQL Server express if it need to be a server based system.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi all,
I'm new to C# and was wondering what is the best way to execute a .ps1 file to perform a task in Exchange. I have a button that when click should execute the ps1 file and perform a test like get mailbox.
As part of the task, I am using a browse to all users to input and then display the output in a textbox beneath the button.
Thanks for your help in advance.
|
|
|
|
|
choppol wrote: I'm new to C# and was wondering what is the best way to execute a .ps1 file ..and that's where your specs should pause, and where you Google on how to execute a PowerShell script. Any tutorial and example should be considered.
choppol wrote: to perform a task in Exchange Prolly means executing it on that server, with some Exchange-specific libraries.
choppol wrote: I have a button that when click should execute the ps1 file and perform a test like get mailbox. Means you put the code from the tutorial under the click-event of that button. What kind of button is this btw, is it in WinForms, WPF, something webby?
choppol wrote: As part of the task, I am using a browse to all users to input and then display the output in a textbox beneath the button. How do you browse to all users and what does it have to do with the task?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
To set things up, what I was trying to do was make a TextBox flash when a user misses a required input. I got it to work but I don't understand the error I was getting at first.
Code that had an exception:
private void FlashRequiredTextBox(TextBox target)
{
ColorAnimation flash = new ColorAnimation(Colors.White, Colors.Red, new Duration(TimeSpan.FromMilliseconds(75D))) { AutoReverse = true, RepeatBehavior = new RepeatBehavior(5D) };
target.Background.BeginAnimation(SolidColorBrush.ColorProperty, flash);
}
The exception that was thrown:
Cannot animate the 'Color' property on 'System.Windows.Media.SolidColorBrush' because the object is sealed or frozen.
I understand why the exception is thrown but what I don't get is why this code fixes it.
private void FlashRequiredTextBox(TextBox target)
{
ColorAnimation flash = new ColorAnimation(Colors.White, Colors.Red, new Duration(TimeSpan.FromMilliseconds(75D))) { AutoReverse = true, RepeatBehavior = new RepeatBehavior(5D) };
target.Background = new SolidColorBrush(Colors.White);
target.Background.BeginAnimation(SolidColorBrush.ColorProperty, flash);
}
Can somebody with a better understanding of WPF control rendering explain this?
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016
|
|
|
|
|
The default style for the TextBox control sets the background brush to:
<Setter Property="Panel.Background">
<Setter.Value>
<DynamicResource ResourceKey="{x:Static SystemColors.WindowBrushKey}" />
</Setter.Value>
</Setter>
(I couldn't find an official source, but you can view the default styles using Style Snooper[^].)
That configures the background to use the SystemColors.WindowBrush , and to dynamically update whenever the Windows colour settings are changed.
The WindowBrush property calls the MakeBrush method[^], which explicitly freezes the brush:
private static SolidColorBrush MakeBrush(CacheSlot slot)
{
SolidColorBrush brush;
lock (_brushCacheValid)
{
if (!_brushCacheValid[(int)slot])
{
brush = new SolidColorBrush(GetSystemColor(slot));
brush.Freeze();
_brushCache[(int)slot] = brush;
_brushCacheValid[(int)slot] = true;
}
else
{
brush = _brushCache[(int)slot];
}
}
return brush;
}
When you try to animate that brush from the code-behind, you then get an error because it has been frozen: Freezable Objects Overview[^]
With your second code block, you've set the background to a new SolidColorBrush , which hasn't been frozen. The animation then works as expected. You could also use:
private void FlashRequiredTextBox(TextBox target)
{
ColorAnimation flash = ...;
if (target.Background.IsFrozen) target.Background = target.Background.Clone();
target.Background.BeginAnimation(SolidColorBrush.ColorProperty, flash);
}
As far as I can tell, when you configure the animation in the XAML markup, the system ensures that the background brush is not frozen. When you configure the animation from the code-behind, that check is left up to you.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I love this place, almost every day I can find something new (to me) and interesting. I have a great dislike for grossly animated views however this may be useful to get in a users face
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Ah, it makes sense that default brushes are created and then frozen right away. If they weren't, I suppose it might cause all sorts of nasty side effects. Thanks for the detailed explanation.
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016
|
|
|
|
|
Could some one suggest some way to improve the performance of getting log description. We use FormatDescription() to read the description of the logs and the performance is pathetic.
To put the matter in perspective, if I comment the FormatDescription(), my application of parsing 28000+ logs completes in about 2 minutes, and on adding that line the application takes well over 1.3 hrs!
Regards,
Pitrak
|
|
|
|
|
FormatDescription is well known for being slow - the general recommendation is to drop down to the Win32 APIs instead.
This space for rent
|
|
|
|
|
Hi,
Thanks for the reply; could you please help me with the name of the Win32 API to use.
If you could provide a simple code snippet, that would be really helpful.
I am actually intending to use C# API's to build my application. So, how would I be using the Win32 API's?
Regards,
Pitrak
|
|
|
|