|
OK, please be gentle, I am a newbie to any form of windows coding.
I am attempting to build an application that places some files on a remote server defined as a UNC path.
Now if the path is pre-authenticated on the xp client all works well. But if the password has changed or never been pre authenticated of course I get an System.IO.IOException: Logon failure: unknown user name or bad password.
So the question is.
How the heck do I authenticate from my c#.net app against the remote server to establish a successful connection.
I would have thought the UNC file path could have contained the user credentials, But alas I cannot find it despite searching through the mountains all the search engines generate
|
|
|
|
|
try "IWshRuntimeLibrary". if you have username password of remote server you can map a network drive. Actually it is a win32 library but you can find how to use it from c#.
hope this help.
|
|
|
|
|
Do you know a component or package in .NET that enable synchronize between folder located in FTP server and between local folder?
In addidtion, how many connection can I open simultaneous (using threads) in such synchronization package?
|
|
|
|
|
For FTP communication we now use Rebex's FTP.net[^] library. You'll have to write the synchronization logic yourself.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Lets imagine I have form FormA which has 1 button on it and I created it using VS.NET by dragging and dropping. Now I want to create another form FormB which will have a 2nd button on it. I want FormB to inherit form FormA--simple enough. But in order for me to add the 2nd button to FormB, I would have to do it programmatically, correct? In other words, I can not really drag and drop a 2nd button onto FormB.
The reason I am asking is because we often need to include a few extra controls to a form for specialization but when we do this, we lose design time flexibility.
If you have any suggestions, or if there is a design pattern which comes in handy in this situation, please let me know.
|
|
|
|
|
Create a new form and then in the designer have it declared as:
class FormB : Form A
{
FormB():
FormA()
{
}
}
This should allow design time support in the forms designer.
At university studying Software Engineering - if i say this line to girls i find they won't talk to me
Dan
|
|
|
|
|
I will try that. Are you suggesting I will be able to see the 2nd form at design time?
When I tell girls I am studying Software Engineering, they respond by saying "Oh wow! What is that?" Then I tell them it is creating artificial intelligence (which is just one branch, but who cares!). This really impresses them.
|
|
|
|
|
Yeah the second form should render in the form viewer with all the components of the form it inherits from.
Hmmmm think I must live in an area with the wrong type of girls!!!
At university studying Software Engineering - if i say this line to girls i find they won't talk to me
Dan
|
|
|
|
|
Hi.
I'm using .Net 3.5, C#, CryptoStream with DESCryptoServiceProvider.
I've got an interesting problem. When i try to decrypt some message or file, i need to somehow detect if the key, that i pass to the CryptoStream, is valid (actually, i need to detect if the key is invalid). How can i manage this?
I tried to catch CryptographicException, but it causes lot's of problem..
thanks
|
|
|
|
|
Member 4083157 wrote: I tried to catch CryptographicException, but it causes lot's of problem..
Such as?? Because that's about the only method you have for detecting an invalid key.
|
|
|
|
|
The main problem is that CryptographicException do not throws on some invalid keys. i tried to check them with DES.IsWeakKey and DES.IsSemiWeakKey, but result is always false..
Then, to catch a CryptographicException i need to wait the whole cycle of decryption and it takes some time, and the programm's task is to find the right key in some range of keys. Of course, i use distributed search, but this problem is still actual..
Is there any way to use hash of the encrypted and decrypted data?
|
|
|
|
|
Member 4083157 wrote: Is there any way to use hash of the encrypted and decrypted data?
That would defeat the purpose of encryption pretty quickly now, wouldn't it?? You simply don't have a way around this. There are only three possiblities here.
1. The key is blatantly invalid, such as incorrect length or tampered with.
2. The key is just the wrong key, in which case, the only way to tell is to try and decrypt a message with it.
3. The key is correct.
There's no way to predict in a quick fashion if the key is correct or not. It just has to be tried to find out. That takes time, and there's no way around it.
|
|
|
|
|
|
Why can't you compare it to the key used during encryption?
|
|
|
|
|
Because i don't have such key..
|
|
|
|
|
If you're trying to get hints on how to break the key or encryption, forget it. We're in the business.
|
|
|
|
|
I installed .Net framework 3.0 but not getting the templates of WCF WPF etc. What extra configuration is to be done for that.
Bijay Bhaskar Deo
Thanks & Regard
|
|
|
|
|
Did you install the SDK version of .NET 3.0 or the redistributable version?? Where did you get it from??
|
|
|
|
|
I have a form which has layout like this:
form
|--->usercontrol1
|----->usercontrol2
|---->combobox1
|---->combobox2
What I want to do is when selected item of comboxes changes, unfocus them. I tried this.ActiveControl=null, Findform().usercontrol1.ActiveControl = null, FindForm().usercontrol1.Focus(), FindForm().Focus() etc. on selectedindexchanged event but that comboboxes always stayed focused.
Any other ideas?
|
|
|
|
|
Where do you want to throw the focus after selection has changed?
Also, pay attention to combo box as it has SelectedText (or something like it), so you probably have to deselect that as well. Just a guess.
|
|
|
|
|
I'd like to make usercontrol1 focused.
I'll check SelectedText.
|
|
|
|
|
UserControl's cannot have the focus, however, one of it's child controls can.
|
|
|
|
|
Ok let's forget usercontrol. Do I have to set focus elsewhere to unfocus combobox? If yes how can I focus the form?
|
|
|
|
|
kensai wrote: Do I have to set focus elsewhere to unfocus combobox?
Yes, some control has to have the focus.
kensai wrote: If yes how can I focus the form?
You can't. You have to focus some other control on the form.
|
|
|
|
|
Hello all. I have a couple of questions regarding assemblies.
Can an assembly contain other assemblies?
Can an assembly directly contain types?
Any help would be appreciated. Thanks.
"If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra
|
|
|
|