|
Why not use base 64?
The method Convert.ToBase64String turns a byte array into a base 64 encoded string.
---
b { font-weight: normal; }
|
|
|
|
|
I don't believe the output of System.Security.Cryptography.sha1managed.computehash() is base64, and that's what I'll be comparing this against.
-- modified at 17:14 Wednesday 26th July, 2006
Actually I'm getting ahead of myself. You'd be best to ignore me...
|
|
|
|
|
Hello all, i am new here and have been assigned a project. We have a need to delegate a small group of individuals the ability to disable and enable AD users in a certain OU. Instead of giving them access to ADUC, i wanted to build a small VB app that consists of a combo box that displays the users in the OU, then a radio button for enable account and another for disable account. Then an apply button and cancel at the bottom. I am new to coding and generally have just gotten snippets and modified them to my own use in the past, but i am having a ahrd time finding the sippet to do what i need. I figure this is an easy one for all of you experts out there. If anyone can lend me a hand, i would be appreciative!
Thanks
Parry
|
|
|
|
|
Hey Parry!
Although I am not new to programming, I am new to VB.NET. That said, perhaps we can pool our minds and come up with a solution for you.
I believe I know what you are trying to do but in order to assist you further I need clarification on the following:
AD
OU
ADUC
How you are storing the users
How you plan to store whether a user is "enabled" or "disabled"
Thank you!
|
|
|
|
|
AD - Active Directory
OU - Organizational Unit
ADUC - Active Directory Users and Computers
I have searched for ways to query active directory (ad) but is it somewhat confusing. Within the Active Directory there are "organizational Units" They work somewhat like file folders in which the users and computer accounts are stored.
How you are storing the users. I would like for the program to just store the "usernames" in the combo box. I do not care if they are all lost when the program is closed. Then I would like to use the "username" selected from the combo box to be stored as a variable to use when the "apply" button is pressed.
How you plan to store whether a user is "enabled" or "disabled" - I would like to read that form Active Directory, if possible and then reflect the status on the radio buttons "checked" field. I was able to code to turn off one if the other is on
In the end, when the "apply" button is pressed, i would like the user selected in the combobox to have the status applied based on the status of the radio button.
Thanks for your help.
|
|
|
|
|
Hi - how would one go about exporting a datagridview to MS Word? I have numerous (dynamically created) dgvs, and they need to get on a Word document (for reporting purposes) - including cell colors and row/column headers.
can't find anything like this (basically a cut and paste operation)
Any guidance would be sincerely appreciated - thank you in advance.
Cheers,
- James
|
|
|
|
|
[Thank you, Joshua -->
reply:
Hello, James!
I was able to find some code to do precisely that here on codeproject. The code to do so is as follows:
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.doc");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.word";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
myDataGrid.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
The URL actually has code for exporting to Excel, Word and Text files and can be reached via the following link:
http://www.codeproject.com/aspnet/DAtaGridExportToExcel.asp[^]
/]
May I ask for a little more help though (d'oh! ). My dgvs are on a windows form (VS.2005) - and I'm not quite sure if these objects are viable in this environment (i.e. - the HttpTextWriter is not found in System.Web)
so, looking away from the syntax of this, functionally what is happening is that each line of data from my datagridview is being sent to the writer - which then inserts it into the word doc, correct? If so, this shouldn't include formatting, colors, etc. - correct?
looks like i should be able to do this by pushing it line by line into excel and formatting there - and then automating a cut and paste operation into word - but that's a little excessive!
ideas? (thanks again for the help)
|
|
|
|
|
When is it appropriate to use one over ther other when closing/cancelling a form? Advantages, disadvantages, memory leaks?
|
|
|
|
|
If Dispose is implemented, you should use Dispose after calling Close. But since not everyone follows the intended design, you should read about the implementation if you are using third party Classes
|
|
|
|
|
|
Hi, I was wondering if anyone could help me.
I am trying to write a Terminal Server administration program and would be very grateful for some advise on how to display all the currently logged on users.
I would also like it to display the session type, ID, logon time, and the current state, of all the users in one ListView. A bit like the Terminal Server Manager by Microsoft. Help would be appreciated and I am using VB.NET Express Edition. Code would be helpful, Thanks.
|
|
|
|
|
This might sound a bit hard but any advice would be appreciated, even if its just a tiny bit of code. Thanks
|
|
|
|
|
Hi people... i am completely new to vb express. I got a code to finish for my school project and it need to use linked list in it. i tried doing it using some of the code put up on net, but i get an error saying VB doesnt support certain statements... I need someone to help me please... i have to finish this by saturday..
-- modified at 14:24 Wednesday 26th July, 2006
|
|
|
|
|
Show the trouble code and someone might be able to help some. But don't expect anyone to do your homework assignment for you.
|
|
|
|
|
I have an MDI application. The parent window has a MenuStrip (MS1) with the common commands, and the child window has a menu strip (MS2) with some specific commands.
When the child window is maximized, the commands from MS2 are correctly merged into MS1. However, the menu strip itself still gets rendered across the top of the child form, so it looks as though there is one menu strip above the other. Basically, all the menus get moved from the MS2 into MS2, but MS2 still renders, just as an empty Menu Strip.
How can I prevent this behavior?
I would prefer if the menu strips merged as they do now, but when merged, the child forms menu strip was not drawn.
|
|
|
|
|
I created a table with 4 column. ProductID is one of them but I don't want to show this column. I set the DataSource of a DataGrid to this TABLE. However, vb.net doesn't like it when I use
mygrid.Columns("ProductID").Visible
Is there a way to hide this column? Any comment would be much appreciated.
nImStucked
|
|
|
|
|
I used this set of FAQs to help me tinker with my datagrid, so it might help you out: http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx
|
|
|
|
|
Just replace the string with index of column..
YourGrid.Columns(0).Visible = False
|
|
|
|
|
Hey all,
Newbie question here that probably has a simple solution that I can't seem to find, but I'm new to programming and am still playing around.
What I'm trying to do, is create a program that will allow someone to enter data into a couple textboxes. What I want to happen is, to have a button that allows the user to "save" his/her entered data in these textboxes so that when they launch the program again, these changes are displayed until they are changed again. Can anyone give me some sample code that would accomplish this?
Any help or links to appropriate articles would be greatly appreciated.
Thanks!
Oh, forgot to mention that I'm using VB.Net 2003.
-- modified at 12:33 Wednesday 26th July, 2006
|
|
|
|
|
Hi, you can do this using the registry. Well thats what I did.
To save the settings to the registry you need this code
My.Computer.Registry.CurrentUser.CreateSubKey("name of your program")<br />
<br />
My.Computer.Registry.SetValue_("HKEY_CURRENT_USER\name of your program","textbox name", textbox name.Text)
To load the data back into the textbox you can use this.
textbox name.Text = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\program name", "textbox name", Nothing)
You need to put this code in a button or a timer and something like that.
Good luck
-- modified at 13:23 Wednesday 26th July, 2006
|
|
|
|
|
I'll give that a try. Thanks!
|
|
|
|
|
Just wanted to thank you again for the help. I got it to work properly, although using a slightly 'different' wording, i suppose. Your code was giving me some errors, so I looked for a couple of different ways of doing the same thing and this one ended up working for me.
My code ended up looking like this:
<br />
Dim CompSN_Reg As Microsoft.Win32.RegistryKey<br />
<br />
CompSN_Reg = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("ACQ01")<br />
CompSN_Reg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("ACQ01", True)<br />
CompSN_Reg = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("ACQ01\\CompSN")<br />
CompSN_Reg.SetValue(txt_ACQ01_Comp_SN.Text, txt_ACQ01_Comp_SN.Text)<br />
Same idea in theory... but so fickle. Ahhh, I'm constantly reminded why I've always hated programming.
Anyways, Thanks!
|
|
|
|
|
Oh well, I don't mind. I'm quite new to VB.NET
Aaron
It might be because I use VB.NET 2005
-- modified at 17:44 Wednesday 26th July, 2006
|
|
|
|
|
Beside using the registry, you can use My.Settings to store your setting.
You have to create your setting in Design Time
You can set this in Project Properties and point to Settings Tab.
The settings will be save into XML format in your application path
here's the code to change and save the settings
----------------------------------------
My.Settings.UserName = "BrazenSix"
My.Settings.Subject = "About what??"
My.Settings.Save()
to retrieve settings value
----------------------------------------
Dim UName, USubject As String
UName = My.Settings.UserName
USubject = My.Settings.Subject
|
|
|
|
|
I cant find any sample code for Remote Desktop in Visual Studio 2005. Does anyone have some sample code to connect to a terminal server or know where I can find some? I have played around with the "Microsoft RDP Client Control", but have not been able to get it work correctly. I would like to be able to connect, change the screen size, etc.
|
|
|
|