|
Ok. Let me specify what I am actually doing.
I am using windows application for uploading file on server. My client applications were using by our various CLIENT's. In that I am using one folder where there will be more files in that and once CLIENT's finish there work they save it to that folder. then by using threading concept I am fetching all the files and uploaded on the server. Also in that I need to check the size of files that is being uploaded on the server.
In that I dont want to set some credential like username and password.
By using your solution webclient.uploadfile() is this will work.
How can i use Webclient.UploadfileAsync?
Thanks
sjs
modified on Saturday, April 10, 2010 7:38 AM
|
|
|
|
|
sjs4u wrote: Let me specify what I am actually doing.
That would have nice to do in the first post.
sjs4u wrote: webclient.uploadfile() is this will work.
Why?
sjs4u wrote: How can i use Webclient.UploadfileAsync?
RTFM
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
webclient.uploadfile() :- for This should I have to write credential? Right Now my path is http://loacalhost/server/file.wav.
as i m uploading .wav file.
Why I am saying that I want to use same code only for uploading the file.
I will check..Thanks
|
|
|
|
|
sjs4u wrote: want to use same code only for uploading the file.
What???
sjs4u wrote: This should I have to write credential?
Why? Does the website you are posting to require login?
sjs4u wrote: I will check
This is the only part of your response that makes sense
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I have two textbox BP_S and BP_D
how can I make sure if one textbox is not null then the other should not be null as well... && and || won't worked I guess..
|
|
|
|
|
There is no room for guessing in software development.
bool isBad = text1!="" && text2==""
[CORRECTION: TextBox.Text never is null, it is an empty or a non-empty string]
|
|
|
|
|
There is no room for guessing in software development.
I have to mark it.. you are right...
|
|
|
|
|
I prefer this for String type:
bool isBad = ((String.IsNullOrEmpty(text1) == true) || (String.IsNullOrEmpty(text2)))
My 2 cents
|
|
|
|
|
Why are your textboxes null to begin with? How about if (BP_S != null && BP_D != null) ? Or did you mean that it is ok for the second textbox to be null as long as the first textbox is null as well: if (BP_D != null || BP_S == null) ?
(this is not help, btw, it's a bunch of questions)
|
|
|
|
|
no i mean:
if the user entered BP_S then he MUST enter BP_D
similarly, if the user entered BP_D then he MUST enter BP_S
but user can leave both BP_S and BP_D as NULL
|
|
|
|
|
Ok so more like this: if (BP_S.Text.Length == 0 || BP_D.Text.Length != 0) ?
|
|
|
|
|
yes but this code will force the user to enter one of the textbox.. What if the user wants to leave the null?
|
|
|
|
|
Ok it's quite late here and I'm tired so I could be wrong, but I'm fairly certain that if they are both null, that condition will evaluate to true
|
|
|
|
|
it's ok.. rest now I will also sleep and come back later... it's 1:30am here in Bahrain.. Sweet Dreamz
|
|
|
|
|
Wow, this is probably the first time I've seen a valid use for the EXCLUSIVE OR operator:
if (!(string.IsNullOrEmpty(textBox1.Text) ^ string.IsNullOrEmpty(textBox2.Text)))
{
MessageBox.Show("Valid");
}
else
{
MessageBox.Show("Invalid");
}
You could also do that with && and ||, but this is probably the most succint technique.
|
|
|
|
|
aspdotnetdev wrote: but this is probably the most succint technique
Maybe 2 or 3 characters shorter
|
|
|
|
|
most succinct?
if exclusive OR is what the OP wants, then there is no need for XOR, OR, AND operators!
Mind you, TextBox.Text never returns null.
MessageBox.Show((textBox1.Text.Length==0)==(textBox2.Text.Length==0)?"Valid":"Invalid");
|
|
|
|
|
You fool! It can be MUCH more succint!
MessageBox.Show((textBox1.Text.Length>0)==(textBox2.Text.Length>0)?"Valid":"Invalid");
|
|
|
|
|
Do you mean
MessageBox.Show(((tb1.Text.Length>0)==(tb2.Text.Length>0)?"V":"Inv")+"alid");
?
|
|
|
|
|
Haha, I did exactly that, but then found it to take up more characters than the other method, to be less clear, and to potentially take up more processing time (the strig concatenation). If you make both words lowercase, you can get it down to exactly the same number of characters as the one I posted, but it still has the other issues. But nice try.
|
|
|
|
|
correct.
MessageBox.Show((tb1.Text.Length>0)==(tb2.Text.Length>0)?"OK":"!OK");
|
|
|
|
|
I had a nice long reply I was working on, but my Internet decided to go down just as I posted it. So, lucky for you, you get the short version instead:
((a.L>0)==(b.L>0)).S();
|
|
|
|
|
why would you need a long reply to come up with a succinct code snippet?
Anyway, with a real pre-processor, it is trivial:
T
|
|
|
|
|
If my Internet didn't go down, you'd know.
Why use a letter with such a high ASCII value? This seems more optimal:
A
As a bonus, your left pinky is already on that letter.
|
|
|
|
|
I suspect the energy saving comes from having fewer 1-bits.
|
|
|
|