|
|
List<int>[] arrayOfIntLists = new List<int>[10];
|
|
|
|
|
Assuming there is a dataset i.e. ds
And there are tables in the dataset i.e. 10 but it can vary...
Then I think I should have a foreach loop to go through the tables and populate the collection.
foreach (DataTable table in dsMarketValuesCombinedByIndex.Tables)
{
Not sure what to put inside the foreach loop.
Thanks
|
|
|
|
|
List<List<BaseProvider>> providerMatrix = new List<List<BaseProvider>>();
led mike
|
|
|
|
|
Is this different?
List<BaseProvider>[] providerMatrix = new List<BaseProvider>[];
|
|
|
|
|
|
Hello!
I'm trying to write a tool that associates some data with the currently logged on Windows user account. I.e. the encryption key for the file is generated based on the user.
How can I do this?
Of course, just using the user name is bad, because it should also depend on the users password. Unfortunately I haven't found a function to get the user's password (is there one?).
I tried using the System.Security.Cryptography.ProtectedData.Protect function. The problem with this approach is that this function returns a byte array that includes a seed. I.e. when calling this function twice, you'll never get the same results. But this is a requirement, as I want to use its output only as key for my own encryption engine (which offers choice between different algorithms, like AES, Twofish, ...).
Best regards
Dominik
|
|
|
|
|
Using the users name is a bad idea because a user can change their name.
You also cannot use a users password because, for one, passwords expire and change, and two, there is no function to get the password.
About the only thing that doesn't change in a user object is it's SID.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I know that the SID is the only constant thing in a users account, but it is public isn't it?
An administrator can easily read all SIDs of users in a network. Therefore, using just the SID is a bad idea, too...
Any other way?
Thanks for your reply and best regards
Dominik
|
|
|
|
|
I've just found a solution and wanted to quickly let you know it, in case it's interesting for you, too:
First, a random byte array is generated using a cryptographically secure random number generator. This is the key used for encryption. It is protected using ProtectedData.Protect with the DataProtectionScope.CurrentUser option and written to the registry.
When loading, the protected key is retrieved from the registry, unprotected using ProtectedData.Unprotect and used as decryption key for our file.
I'm not sure what data ProtectedData is using, but it seems that the password can be changed, without making the ProtectedData behavior change, i.e. the user's password actually doesn't matter. Same applies to the user name. Probably Windows keeps some secret key for each user, which we can't access manually.
Best regards
Dominik
|
|
|
|
|
hi
i write my app with vc#2005 and crystal report for vs2005, i want to create setup package for my app, but how to do ??
thanks..
|
|
|
|
|
|
Hi,
A stored procedure runs three select queries.
Each of these select queries is being assigned to a table (See below).
The question is: In this case I know how many tables are returned so I use the "oDA.TableMappings.Add" three times. But what if I do not know how many tables are returned? How can I make a dynamic loop arouond "oDA.TableMappings.Add"?
Alternatively, Is it better to retrieve the whole of data into one dataset and then separate the data into datatables?
This is what I am doing at present:
SqlDataAdapter oDA = new SqlDataAdapter(oCmd);
//use Tablemappings to name the retrieved tables...
//otherwise have to use indexes to refer to each table...
oDA.TableMappings.Add("Table", "Curves1");
oDA.TableMappings.Add("Table1", "Curves2");
oDA.TableMappings.Add("Table2", "Curves3");
DataSet dsData = new DataSet();
oDA.Fill(dsData);
This is what I am trying to do:
SqlDataAdapter oDA = new SqlDataAdapter(oCmd);
int i = 0;
foreach(table in oDA)
{
oDA.TableMappings.Add("Table" + i, "Curves" + i);
}
DataSet dsData = new DataSet();
oDA.Fill(dsData);
|
|
|
|
|
Hi,
I'm new to C# and need some help with scrolling in panels.
I have a PictureBox (PB1) on a Panel in a Windows Forms appliction. PB1 is larger than the panel so scrollbars are needed on the panel. The Panel's AutoScroll property is set to true and the PictureBox's SizeMode is set to autosize. I have added a small PictureBox (PB2) on top of PB1 (in the upper left corner of PB1). So far, everything is ok and displayed as intended.
Now, I want to drag & drop PB2 from the upper left corner of PB1 to the lower right corner of PB1. But since I cannot see the right hand side of PB1 (it is larger than the panel) then the panel needs to scroll PB1 to the right and down when the dragged PB2 is close or on the right and lower borders of the panel.
Is there any information out there that can point me to the right direction how the scrolling can be implemented?
Regards,
|
|
|
|
|
hello,
I've got the following regexpression:
"<span .*bbc_underline.*>(.*)</span>"
and the following input string:
"this <span class="bbc_underline">is underlined <span class="bbc_strikethrough">and striked through</span>text.</span>"
when I do a replace on the expression, I get the following result:
"this text."
I'm quite new to regular expressions. the goal in the expression above is to yield the following result:
"this [u]is underlined [s]and striked through[/s]test.[u]"
but somehow, the first expression eats up more then it should. btw, I don't know if or what is nested. I just have a couple of span's with given classes, that will "turn into" square brackets. can somebody please help? A ton of thanks in advance.
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
I would normally use:
"<span [^>]*bbc_underline[^>]*>([^<]*)</span>" The "^" within square-brackets says that the RE parser can match any character except the specified ones. I cannot remember if you need to use a backslash to escape the "<" character.
Your example text contains nest spans, so the above RE would match the inner "strickthrough" span on the first pass, then the outer "underline" span on the following pass.
You might find that the "Greedy and Lazy" section of http://www.codeproject.com/dotnet/RegexTutorial.asp[^] can simplify the expression.
Hope that helps.
Andy
|
|
|
|
|
hey andy,
lot of thanks for your reply. I've tried it out but the RE you've provided does not work. In the meantime, I came up with this expression
"<span .*?bbc_underline.*?>(.*?)</span>"
...but it does not work correctly either, since it matches the first occurence of </span> instead of the last.
In the case I did not explain it correctly: What I want to achive is to match the first occurence of <span SOMETHING "bbc_underline"> with the last possible occurence of </span> and replace everything within with [u]$1[/u]. I don't know how many nestings there are. The span classes I use come from a predefined list (bbc_underline, bbc_italic, bbc_strikethrough and the like)
I would greatly appreceate further help.
Matthias
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
i have a datatable and want to display the contents of datatable in a datagrid
when i want to put the checkbox in datagrid separately they are visible.But if i integrate it with datatable
it doesn't show the checkboxes instead it shows (null)
how can i make the checkboxes visible?
i m placing the checboxes in datagrid with the help of this link
http://www.windowsforms.net/FAQs/default.aspx?PageID=2&ItemID=537&CategoryID=3&tabindex=3
I m using C# WINDOWS APPLICATION.
AND VERSION IS 2003 OR 1.1
|
|
|
|
|
Hello,
I´d like to program a simple Program in C# with a windows form as the main window. From the main menu I want to open a plugin-dll which automatically extends my main menu with new plugin-specific entries.
I read the article about the Razor framework, which really is a nice work, but it is way too complex for my needs.
Any Ideas?
Thank you,
Oliver
|
|
|
|
|
Normally you would define an interface, such as IPlugin, which your application would recognise and which the plugins would conform to. This would have a set of methods that plugins would have to provide the implementation for. Your methods could be something along the lines of:
public interface IPlugin
{
void Loading();
void DoWork();
void Shutdown();
}
Next, you need a mechanism to recognise plugins. This could be by having them loaded from a certain directory, or having a config file which lists the plugins associated with your application.
Finally, you need to load these plugins in. This can be loaded using Activator.CreateInstance.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thank you very much...
But how can I extend my menu entries in the main window when the plugin is loaded? The main program should not know anything about the functions of the plugin.
Thanks,
Oliver
|
|
|
|
|
HI ,
Is there some wayaround to update Form's control from Class Library ?
I have a classlibrary as a seprate project and GUI (Form) as a separate project in same solution. And have aded reference of Class Libaray to my GUI project from where I access its functionality.
Now I want that when ever any particualr event happen in ClassLibrary (new data is aded from database or some exception caught)I write this to my LogFile but also WANT TO DISPLAY ON LABEL on Form.. , how can I acheive this thing ?
Any sugestions ???
And If i have ran an application from Visual Studio by clicking 'play button' , while that application is runing , that play button stays disable .. what if I want to run one more instance of that application from Visual studio ???
Thanks in advance.
zink
|
|
|
|
|
top of the morning to you?
><
|
|
|
|
|
|
zinc_z wrote: ???
HELLO
Before you get too confused, sharpiesharpie's replying to an earlier post that just said hi.
Deja View - the feeling that you've seen this post before.
|
|
|
|