|
NormBohana wrote:
pc.Add("[@small-animal-cost]",SqlDbType.Money, 8);
Lose the square brackets. Where did they come from ? I dunno why I didn't see that before.....
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello...
I'm trying to track the time for a user who login from Active directory in a domain controller. I'm having a problem with in which I don't know how to do that actually in real time, so that controlling the access of the user say about 10 hours only, after that the account will be disabled, I don't want that the user use these hours sequentially, but in a whatever manner he wants it, I mean login say for 5 hours then he logout, so my counter should check the remaining time for him , and if the total time is 10 hours the remaining time for him is 5 hours, so when he access again the domain controller he has only 5 hours remaining.
Can you help me with this problem, please.
Or if you know anyone who can help me with this problem or any articles discuss this problem.
Thanks in advance.
|
|
|
|
|
How can i do to replace Html Tag
For example in my project when i input <br> or <p> the error message will display
Could you can write an function in C# to replace the HTML Tag
Thanks for helping.
I tried so hard and got so far
|
|
|
|
|
You can make a function that replaces all the ( < ) tags with (_&_l_t_;_)(<)
and the closing tag( > ) with (_&_g_t_;_). (>)
Note:
You must remove the underscore character (_) from all the codes.
|
|
|
|
|
If you need an HTML-Encoded string you can use the System.Web.HttpUtility.HtmlEncode function.
You must reference the System.Web assembly to use this function.
If you need to actually strip the Html tags you coud use a regular expression like this:
string cleanedText = System.Text.RegularExpressions.Regex.Replace(htmlString,@"(?:</?(br|p)[^>]*>)","\r\n");<br />
cleanedText = System.Text.RegularExpressions.Regex.Replace(cleanedText,@"(?:<[/!]?([A-Z][A-Z0-9]*)[^>]*>)","");
This code is very basic. It will not strip scripts nor will it handle tables pretty well.
I hope this is at least a start for you.
|
|
|
|
|
Is there a ActiveX of Autocad for C#.NET? Thank you.
|
|
|
|
|
If Autocad exposes a COM object, you can import it into C# and call it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
Read the docs ? Google ? Look for samples that came with it ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
There is CADIO (search for DXF on the site).
It is for unmanaged C++ so does not work directly in C#
|
|
|
|
|
AutoCAD 2005 and 2006 have managed assemblies you can use. Otherwise you can ActiveX interface that AutoCAD has supported since AutoCAD 2000.
--
Joel Lucsy
|
|
|
|
|
Thank you for u answer but please give me some example.
|
|
|
|
|
I might be able to, but you didn't say what version of AutoCAD you had, what approach you'd like to take, nor the scope of what you're trying to attempt.
--
Joel Lucsy
|
|
|
|
|
I have autocad 2006. I want to develop my application can view AutoCad File (DWG) with some feature like zoom-in zoom-out.
|
|
|
|
|
It sounds like you're trying to create a viewer external to AutoCAD. This isn't really possible without licensing specific things from AutoDesk.
--
Joel Lucsy
|
|
|
|
|
So I'm making an application that alters another Windows program. I want to do it buy synthesizing mouseclicks. I have that aspect working, what I need to do now is determine the location. I'm using GetWindowLocation, However the values it returns are kind of absurd. SO I'll post my code(stolen mostly from another post) and if anyone can figure out where I went wrong...
<br />
[DllImport("user32.dll")]<br />
private static extern bool GetWindowPlacement(IntPtr hWnd, ref WindowPlacement placement);<br />
public struct WindowPlacement{<br />
public uint length;<br />
public uint flags;<br />
public uint showCmd;<br />
public POINT ptMinPosition;<br />
public POINT ptMaxPosition;<br />
public RECT rcNormalPosition;<br />
}<br />
public struct POINT{<br />
public long x;<br />
public long y;<br />
}<br />
public struct RECT{<br />
public long left;<br />
public long top;<br />
public long right;<br />
public long buttom;<br />
}
That's my structure definitions.
I call it like this
<br />
WindowPlacement Place;<br />
GetWindowPlacement(Handle, ref Place);<br />
Ok so there it is, the values return seem pretty absurd. Negative numbers 15 digits long and such, nothing I can make a mousepointer move to without errors. Anyhelp would be great.
jake
|
|
|
|
|
In C++, a long and an int are both the same size. Change the longs to ints in POINT and RECT, and the rcNormalPosition will become valid and accurate, I've just tested it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi
how i can make a stand alone c# windows application?
thanks
|
|
|
|
|
select the project type Windows Application in Visual Studio?
The only thing you need is the .NET framework
|
|
|
|
|
Hey guys;
I want to know how can I syntax colorize a textbox. Like puting a little squiggly MSword underline under a text or letter.
Any ideas please write.
Thanks
|
|
|
|
|
Two words - owner draw. You have to handle drawing something like that yourself, the textbox does not support it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Please search a bit yourself before posting. Searching for 'syntax textbox' here on CodeProject gives you an article which is no two days old.
|
|
|
|
|
I think in a textbox you cant do that.
A RichTextBox much better basic for it.
I think you can start if you read the RichTextBoxExtended in docs.
But I remember somwhere I find a code shomething like yorur wish, if I find it, post it to you.
|
|
|
|
|
Does anyone have any references on how to find out the mail settings on a PC using C# ? The program I'm working on needs to send emails and I'm hoping that I can get the mail server details and reply address from outlook withouth the user having to enter them.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christain,
Can we look up the info in the windows registry? For example, in the key:
HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\
or somewhere in the user profiles
|
|
|
|