|
|
Hello, I've found an article on here that describes how to mask keyed in characters for inputting passwords:
ConsolePasswordInput[^]
At the bottom of this article it states that it's an application (obviously) but it can be easily converted into a library. I'd love to convert it into a library but I have no idea how to do this.
I'm relatively new to C#. I'm currently running MS Visual Studio 2005 with .Net Framework 2.0
I was thinking I could start a new Class Library project and just paste in the required code, but I believe that will create a .dll file. I believe that once my application makes use of this library it will have to register itself, and I was trying to avoid having my application register anything.
If anyone is able to help or even just point me in the right direction, I would greatly appreciate it. Please let me know if you need anymore information!
|
|
|
|
|
A Class Library project will produce a DLL. By registering, I assume you're talking about registering the DLL to the GAC... Which isn't necessary. You can create a new class library project, and paste in the necessary code. Then have your application reference that DLL (or project if you have both projects in the same solution) to use the classes in the library.
If you don't want to do that, you can paste the necessary code into your application's project instead, which will work just the same, it just won't be usable by other projects.
Does that help?
Try code model generation tools at BoneSoft.com.
|
|
|
|
|
You are correct that it would create a .dll. You dont have to register it, however, unless you want to, but is usually unnecessary unless you plan on a lot of apps accessing it. Just compile the dll and add a reference to it in your projects. It will be copied and distributed with your app (in the app folder) without registering.
If you do decide to register your dll, just create a strong name with the sn.exe utility (from the .NET SDK command prompt) to create a key pair, then assign that to your [assembly:KeyName] attribute of the .dll (assemblyInfo.cs/vb). Then recompile and use gacutil.exe (.NET SDK command prompt) to register the dll in the GAC. Only do this if it is absolutely necessary, however.
HTH.
Aaron Dilliard
|
|
|
|
|
Thank you both for your help - I'm going to give this a try tomorrow
Now that I know a dll doesn't have to be registered, it should all be ok!
|
|
|
|
|
Just thought I'd let you all know that I managed to get the library working successfully. Thank you for all your help
|
|
|
|
|
On many of my applications I make use of a ListView control, that has a certain color displayed on the column that is currently sorted. It also highlights rows for special things. In .NET 1.1 this worked perfectly, but whenever I try to import an app into .NET 2.0 (VS 2005) the color highlights only show up when the form loses focus and gets it back. If you scroll, the items lose the color. This also happens when the SelectedIndex changes and the highlight is given to a new row. The previously selected row loses color. As I said before, the only way to get back the color is for the form to lose focus and regain it. Is the ListView drawn differently in .NET 2.0? Anyone else had this issue? Thanks in advance
Aaron
|
|
|
|
|
Aaron Dilliard wrote: Is the ListView drawn differently in .NET 2.0?
I don't think there are any major changes that would break an app.
Aaron Dilliard wrote: Anyone else had this issue?
Nope
My guess is that you're not handling it as well as you could be. Are you deriving from the ListView control and overriding the OnDrawItem method or are you handling the events. If you're handling the events I'd try overriding the method in a custom control.
Sorry I'm not of any further help
|
|
|
|
|
I agree that there are no major changes that would break an app, but even subtle changes in the way the control is drawn could have an effect on 1.1 code. IE, if a WM_PRINT message is sent with the ERASEBACKGROUND flag or something like that, that could be the culprit. I know Microsoft changed the control some in 2.0, and Ill bet that is what is going on. I will just have to rework the code. Thanks for the input.
Aaron
|
|
|
|
|
I have a dll I wrote.
It contains comments and summaries (XML summaries if I'm not mistaken)...
After compiling the dll, and referencing it in another project, summaries are never shown...
Is it possible not to lose them after compiling the dll?
How exactly?
Thanks,
Shy.
|
|
|
|
|
XML comments are never included in the compiled assembly. If you want to see your comments as hints in another project complie your dll with /doc directive (or set "XML documentation file" project property). And always keep generated xml-file close to your dll.
|
|
|
|
|
Hello
If you mean the ///summary block the precedes methods and properties, then the problem would be in your syntax because it should appear as a tooltip when you try to use the methods of your referenced dll.
Post an example of a method's signature that your wrote with its summary, maybe we can come up with something.
Regards
|
|
|
|
|
It should appear only when dll and client application are in one solution. Comments are not metadata and compiled assembly doesn't contain them. So none can show these comments as tooltips (even VS ).
To see the problem just create a simple dll and then make reference on it from another solution. You won't see your XML-comments in tooltips until you generate xml-file with /doc for your dll.
For more information see this article in MSDN Magazine.
|
|
|
|
|
I asked this question before and was referred to a CP article, but I posted another follow-up question and didn't hear anything.
Part 1:
I have a datagrid. I know how to populate the drop-down box with "Part Types." What I want to do is a) If there is an existing record, highlight the PartType saved in the database, or b) if this is a new record, just list the first alphabetical PartType choice.
So I created a function GetDescriptions which I call from my ASP page like thus:
asp:DropDownList ID="test" Runat="server" DataSource = '<%# GetPartDescriptions()%>' DataTextField = "Description"
And here is the function:
public object GetPartDescriptions()<br />
{<br />
string SQLString = "SELECT Id, Description FROM PartTypes ORDER by Description";<br />
SqlCommand cmd= new SqlCommand();<br />
cmd.Connection = new SqlConnection(strConnectSQL);<br />
cmd.CommandText = SQLString;<br />
SqlDataAdapter adapter = new SqlDataAdapter(cmd);<br />
DataSet ds = new DataSet();<br />
adapter.Fill(ds);<br />
return ds;<br />
}
My grid is already editable when they enter the program. So how do I set the index for existing records?
Part 2: I did the function as a separate dataset. (If there is a better way please let me know.) I need to merge this with the original dataset (the main grid of partnumber and stuff). I know I can use the merge method.
What I really want to do is merge the individual record in PartType to the main dataset. Not the entire PartType collection. Can this be done with merge?
THANK YOU THANK YOU!
|
|
|
|
|
Hi,
I currently use visual web developer 2005.
I would like to know how to link from code behind file to the constructor file (set get) inside the App_Code folder
Is there anything I have to import?
I try to set the value into the class file, and get it, after compile no error, but no value returned back....
example:
in .cs file
-----------
String strName= "Baby";
SetProperty sp = new SetProperty();
sp.Name = strName;
String testing = sp.Name;
Trace.Warn(testing+ "this is testing"); // no value returned...
in SetProperty.cs (inside App_Code folder)
--------------------------------------------
public class SetProperty
{
private string strName;
public string Name {
set{ strName= value;}
get{ return strName;}
}
}
Help, ps point me to the correct direction.. thanks.
|
|
|
|
|
|
Hi there,
I am trying to map the items between two mailboxes by drawing lines between them. Kind of like SSIS. I am looking for the best way to do this. Should I create a line object and use it to draw lines? or should I create a GraphicsPath object so that I can keep the track of lines.
How should I deal with user scrolling up and down the listbox because lines must be refreshed and move along with items attached.
Thanks everybody,
Ryan
|
|
|
|
|
Are the two mailboxes in two seperate listboxes or merged into one?
|
|
|
|
|
No these are separate listboxes.
Ryan
|
|
|
|
|
Hello,
jerrymei wrote: Kind of like SSIS
Ehm.. Pardon me but, what is an SSIS??
jerrymei wrote: Should I create a line object and use it to draw lines? or should I create a GraphicsPath object so that I can keep the track of lines.
I don't think it would make a big difference specially that you will have to refresh your lines may times -when moving the form, resizing, repainting, etc...-
jerrymei wrote: I am trying to map the items between two mailboxes
Is that mailboxes, or listboxes?!!
jerrymei wrote: How should I deal with user scrolling up and down the listbox
Some points arising:
1- When the user scrolls one listbox, will the other auto scroll with the same value?!!
2- When you draw lines, what about the items not visible in the listboxes?? Will you hide their lines as well.
It all depends on your point of view, and how you want this form to appear. There are million ways to make something, but you have to choose one
Regards
|
|
|
|
|
Hi,
SSIS => SQL Server Integration Services
Yeah sorry I meant listboxes.
Well I was thinking to scroll the listboxes independently and in regards to non-visible items no I want to keep the lines visible.
Thanks,
|
|
|
|
|
Hello again
Well, whatever will be in the two listboxes, it's a matter of graphical connection between two controls. So, I got an idea for you.
Make a custom UserControl get its graphics and draw your lines in it. This will insure your lines won't go too far if the listboxes items are too many. Now place this Control exactly between your two listboxes, feed it with the tis inputs:
1- Which item is connected to which item. eg. item1-> item5, item 2->item1, etc...
2- Location of each list box, the index of the first visible item. Using this you can calculate the relative location of all invisible items. eg.
item1.Location = FirstVisibleLocation - DifferenceInIndex * ItemHieght
Now you got two arrays of items locations, and the relations of each item to the other listItems. Draw in the graphics area of the custom control, and only inside it shall the lines appear. When the user scrolls or changes the content of any listox, your control must be refreshed
Your Form should look something like this:
--------- --------- ---------
| || \ /|| |
| List1 || - - -\/-|| List2 |
| || /\ || |
| || / \|| |
--------- --------- ---------
Well... Something... like the above
I hope you get my idea. beware of flickering. This may need additional workup if happens.
Regards
|
|
|
|
|
Thanks Nader,
I think this is a very good idea. I am trying different methods now and I am sure going to give this one a try too.
Will Let you know about the results.
Thanks again for your time.
|
|
|
|
|
You are welcome
|
|
|
|
|
Hi Nader,
I am working on your proposed solution. It seems I am getting somewhere with it.
When I want to draw the lines on the control I use the rectangle of the selected item on each list box for starting and ending points, but I think its giving me a hard time because the controls cordinates system is different than the parent form so let's say point1(120,43) is a completely different point on the user control.
Could you tell me how to map these two together, is there anyway to ask the user control to draw the lines based on the parent form cordinates??
Thanks,
|
|
|
|