|
That depends...
What type of database are you using? Access? MySQL? MS SQL Server? Oracle? ...
From whom do you need to protect the logon information?
---
b { font-weight: normal; }
|
|
|
|
|
i am using sql server... and i am protecting it from the users because some of them are pros... and i want to do something pro as well...
|
|
|
|
|
If you're using SQL Server, I'd go with integrated login.
|
|
|
|
|
|
hi to all,
can someone point me in the right direction as to how i go about customizing a TextBox so that it looks like a .NET IDE editor, that is i want to draw a coloured column down left side for line numbers and possible have line folding as well
have googled but nor really comne up with anything specific, only on how to custom draw a control.
i tried this just to see if i could get a column but i got nothing
<br />
public class EditorPane : TextBox<br />
{<br />
public EditorPane()<br />
{ <br />
this.Multiline = true;<br />
this.Size = new Size(300, 300);<br />
}<br />
<br />
protected override void OnPaint(PaintEventArgs pe)<br />
<br />
{<br />
pe.Graphics.FillRectangle(Brushes.Gray, this.Location.X, this.Location.Y, 35, this.ClientSize.Height);<br />
base.OnPaint (pe);<br />
}<br />
}<br />
kind regards,
g00fy
|
|
|
|
|
At first VS editor not standard textbox most code editors create there custom control
Second the left bars that show line folding and line numbers is not draw in the textbox but there are other control itself because the custome editor contain more than one control one of them to display colorized text and others for other tasks like like folding,...
if you want source code for VS code editor like look at the #develop[^]
download the application and looking for the editor source code
I Hope this help
MCAD
-- modified at 15:01 Sunday 11th September, 2005
|
|
|
|
|
that was my first option, but i am having trouble finding it in all the code, have you any ideas of the namespace or class ?
regards,
g00fy
|
|
|
|
|
under namespace ICSharpCode.TextEditor or you can search for textAreaControl.cs you can get more information by reading Dissecting a C# Application: Inside SharpDevelop by written by appliaction developers it is available for free at http://www.apress.com/free/[^]
MCAD
|
|
|
|
|
thank you i will do that
g00fy
|
|
|
|
|
Hi everybody,
When my Win forms app runs I need to check whether somebody has changed the system time (more specific: my app has some kind of a max usage days, kind of like any kind of trial ware, but I cannot rely on an internet connection being present).
I thought already of two options but both are not satisfactory:
1) Add a windows service to the machine and let that one check every x seconds/minutes whether the time has changed. (not good, cause I don't want to add such an overhead to the system).
2) When the app runs it sets the current datetime in the registry, next time it runs it checks whether the current date is later than the one of the previous run. (not good since one can everytime turn back the system clock to 1 second after the last run).
It would be great if I could find out the specific datetime on which Windows started, than take the number of seconds it was running (existing API), and by doing basic math see if the time has changed (taking into account a max 60 minutes difference for day light saving time). Does anybody now how to get the startup datetime of windows?
Or does anybody have another good idea?
Thanks,
Gideon
-- modified at 7:40 Sunday 11th September, 2005
|
|
|
|
|
Option 1 - Not good because what's stoping the user from stooping the service? Plus, you can change the system time without Windows even running.
Option 2 - The registry is a poor place to store information like that. It can be easily changed to reflect a date/time (if you store it as such).
It would be better to track how long your application has been in use. This means incrementing a counter for each minute that ticks by. You could then hide this value in a bogus .DLL file somewhere, preferrably encrypting the value before you write it to the file. Then just decrpyt it and start incrementing the value again the next time the app is started. This method has the advantage that it does rely on the system time at all.
After so many minutes, you just give a notification and quit.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I agree with you on what you wrote regarding to option 1 & 2.
But the solution you set forth is also not 100% satisfactory:
1) The marketing people want a solid expiry date, not one depending on the time it is used.
2) The whole encryption issue (also an issue when storing in the registry) is probablematic, since the encryption keys are stored on the machine of the user (remember, the app cannot rely on an internet connection). But the truth since it is .NET, one can just break the whole date verification out of the code, so that we have to take for granted.
Thanks anyway for your response. And let me know if you come up with some other solution.
Gidon
|
|
|
|
|
gnjunge wrote:
But the solution you set forth is also not 100% satisfactory:
And let me know if you come up with some other solution.
Marketings expectations are also outside the capabilities of Windows, or any OS for that matter. There is absolutely no way to guarantee that the system time your getting is accurate and no way to be reliably notified of any changes to the system clock. Sorry...
gnjunge wrote:
since the encryption keys are stored on the machine of the user
Yes, this is true. But not how you might think. There are a more than a few places in the registry to get an encryption key or salt for an algorithm, such as the SID for the Administrators account. This way, you don't have to store the key/salt yourself, it's already done for you, cleverly disguised as a useful part of the system.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the info. I will talk here with marketing.
|
|
|
|
|
Two Visual studio user interface questions: Reorder and collapse functions...
(Good abbreviation? )
The first question:
Is there any tool or inbuilt funcion in VS that reorders functions?
I got a 10 classes and each got a lot of funcs and data, but all derive from a special class, and thereby have the same funcs. It would be a lot easier to look at them if they where in the same order.
And the second question:
Is there any way to collapse only all functions?
Niklas Ulvinge aka IDK
|
|
|
|
|
Hi!,
I need to hook 456 port on my machine so that I get informed when a request comes for accessing my system using C#!!
Its urgent,please help!!
Thanks in advance
|
|
|
|
|
You'll probably want too look at TcpListner.
|
|
|
|
|
Thanks a lot,but i was not looking for this answer !!
|
|
|
|
|
I need to set a printer to the default system printer from within my application developed using C#, any ideas?
teeka
|
|
|
|
|
You need to get the default printer and set it to PrinterSetting.PrinterName i dont know managed way to get the default printer name but you can use unmaaged Windows API function like GetDefaultPrinter some thing like
[DllImport("winspool.drv", CharSet=CharSet.Auto, SetLastError=true)]
public static extern bool GetDefaultPrinter(StringBuilder pszBuffer, ref int size);
in some where in your code write
StringBuilder defaultPrinter = new StringBuilder(256);
int size = dp.Capacity;
if (GetDefaultPrinter(defaultPrinter, ref size))
{
printDocument.PrinterSettings.PrinterName=defaultPrinter;
}
For More info look at
GetDefaultPrinter^]
GetDefaultPrinter at MSDN[^]
I hope this help
MCAD
-- modified at 14:38 Sunday 11th September, 2005
|
|
|
|
|
Hi All,
I want to make interface like the one made in Visual Studio .NET 2005 "like its window : " which contain dockable forms and tabs.
I want an article illustrate this subject or example
Thanks
|
|
|
|
|
This[^] is a very good control that provides docking and collapsing, just like VS .NET.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hello
I am creating some relationships in code. I have 3 tables Position, Department, and Employee. The relationship is a one to many for these tables. See the details below.
PositionNames are manager, secretary etc
Position - PositionID (PK), PositionName
Department - DepartmentCode (PK), NameOfDepartment
Employee - EmployeeNo (PK), Name, Address, PositionID(FK), DepartmentCode(FK)
I have created a relation with the department and employee as follows:
<br />
DataColumn parentColumn = ds.Tables["Department"].Columns["DepartmentCode"]; <br />
DataColumn childColumn = ds.Tables["Employee"].Columns["DepartmentCode"]; <br />
<br />
ds.Relations.Clear(); <br />
dRelEmployees = new DataRelation("EmployeeDetails",parentColumn,childColumn); <br />
ds.Relations.Add(dRelEmployees); <br />
My problem is l want to add another parent column for the position, do l need to repeat all this code just for the position table. Or can l add another parentColumn and add them all to the dRelEmployees DataSet.
Not sure how to do this.
Thanks in advance,
Steve
|
|
|
|
|
As the relations are two separate relations, you have to add two separate DataRelaction objects to the Relations collection.
To create the second DataRelation object, you need a reference to the partent column and child column.
So, yes, it's most of that code all over again.
---
b { font-weight: normal; }
|
|
|
|
|
Please tell me how to go about taking an existing, working C# application and web enable it.
Rather than produce Windows output as it now does, I need to get it to produce output that can be accessed from a web browser. The output is very simple and contains no clever bits just text and two buttons, one to Print and one for Done.
Regards,
Alf Stockton
-- modified at 2:07 Sunday 11th September, 2005
|
|
|
|