|
I have three dropdownlists and the multiplication of the thse fropdown values is to be populated in this single textbox. Please help me how to use updatepanel in this situation. If I don't use update panel the autopostback event of the dropdownlist is very slow and takes over 40 seconds to respond.
appreciate all your help.
|
|
|
|
|
Can't you just do this "client-side"? Use a "calculate" button. And "script".
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
I have the postback method doing it and is very slow, can you please send the client side of doing the same. I wanted to do it with Updatepanel, is there an easy way to do the same
|
|
|
|
|
Don't you know JavaScript (or whatever)? Isn't that's the way it's supposed to be? La la la.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
How do i create a windows form of a bouncing ball such that when the ball collides with an edge, its movement in the direction perpendicular to the edge should be inverted, while the movement in the direction parallel to the edge should remain unchanged.
There should be a numeric up-down control that controls the interval of the timer that controls the movement of the ball. The interval of the timer should be updated immediately when the value of this numeric up-down control is changed
|
|
|
|
|
|
i have created the windows form but the ball just bounces back and forth
'When the ball collides with an edge, its movement in the direction perpendicular to the edge should be inverted, while the movement in the direction parallel to the edge should remain unchanged.'
i also don't know how to create a code for the numeric up-down control so it can control the interval of the timer
and i have tried goggle i found nothing usefull
|
|
|
|
|
All that means is: when the ball hits an edge, it bounces off at the appropriate angle.
So if it hits the wall like this:
|
|
|
|
----->|
|
|
|
| It rebounds exactly as you'd expect:
|
|
|
|
<-----|
|
|
|
| It if hits at an angle, then it rebounds at an angle:
|
\ |
\ |
\ |
\|
|
|
|
|
Becomes
|
|
|
|
/|
/ |
/ |
/ |
|
Now, presumably, you have a "move this number X" and "move this number Y" values which you add to your ball coordinates each time the timer ticks? So just try inverting the "move number" for the appropriate direction: left and right walls modify dX = -dX, top and bottom modify dY = -dY
Make sense?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
yes it makes sense. i didn't think of that, thank you.
|
|
|
|
|
You're welcome!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Member 13764451 wrote: How do i create a windows form of a bouncing ball such that when the ball collides with an edge, its movement in the direction perpendicular to the edge should be inverted, while the movement in the direction parallel to the edge should remain unchanged. Perpen.. cats?
You know how gravity works, yes? So, you could calculate a trajectory? Add some simple drawing-routines and you have a bouncy ball. It was one of the excercises in the AMOS Basic manual, where bouncing apples would fall from a tree. You can Google the code, but that won't translate easily to a modern C#.
Member 13764451 wrote: There should be a numeric up-down control that controls the interval of the timer that controls the movement of the ball. The interval of the timer should be updated immediately when the value of this numeric up-down control is changed You can do it! Good luck
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Hello guys,
i'm facing a problem in an asp.net project using c#. i'm trying to pull a file from remote server via a web service. Web service then should copy the file and paste it in a specific location where its hosted. Whenever i try to utilize the web service, i got an error message saying : "The user name or password is incorrect". Find below my code:
[WebMethod]
public string copyFile(string year, string month, string accNo)
{
string fileName = "NO002006223665P_201712006036655001.PDF";
string targetPath = @"C:\inv";
string sourcePath = @"\\mjl0571\digSilent\NO002006223665P_201712006036655001.PDF";
string destFile = "";
destFile = targetPath + fileName;
System.IO.File.Copy(sourcePath, destFile, true);
return fileName;
}
any help is appreciated.
Regards,
|
|
|
|
|
The error message is pretty explicit: you can't access the share on the remote computer without providing the correct user authentication details - i.e. the username and password combination it expects.
It may be that you can use impersonation: A small C# Class for impersonating a User[^]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
thank you OriginalGriff.
i did the following:
- add Impersonator class to my project
- enable ASP.NET Impersonation in IIS
- disable Anonymous Authentication in IIS
- add the following code into my web service web.config
<authentication mode="Windows"/>
<identity impersonate="true" />
- Add the following code into my web service
using (new Impersonator(domain, userName, password))
{
System.IO.File.Copy(sourcePath, destFile, true);
}
I'm still getting the same error.
Regards,
|
|
|
|
|
Why do you think that authenticating as you on your computer will automatically give you access to a share on a remote PC?
Try finding out what the share login is set for, and provide those credentials?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Member 7965946 wrote: destFile = targetPath + fileName;
That's probably not going to do what you want. The file will be copied to the root of the C: drive, with the name invNO002006223665P_201712006036655001.PDF .
If you were expecting it to be copied to the folder C:\inv with the name NO002006223665P_201712006036655001.PDF , then you'll need an extra \ at the end of your path. Or, you can use Path.Combine[^] to build the final path:
string fileName = "NO002006223665P_201712006036655001.PDF";
string sourcePath = @"\\mjl0571\digSilent\";
string targetPath = @"C:\inv\";
string sourceFile = System.IO.Path.Combine(sourcePath, fileName);
string destFile = System.IO.Path.Combine(targetPath, fileName);
System.IO.File.Copy(sourceFile, destFile, true);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thank you Richard but still i'm getting the same error.
Regards,
|
|
|
|
|
Run a "net use" command before executing your code.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
|
By the way, it works fine if I run from VS. I gives the error if I run it after hosting in IIS.
|
|
|
|
|
And the error is correct. Stuff in IIS runs under a different user.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Unhandled exception of type System. IO. DirectoryNotFoundException occurred in mscorlib.dll
Additional information could not find part of the path c:\ocr\0.txt
|
|
|
|
|
That suggests that it's looking for that directory. Get the directory name from that using Path.GetDirectoryName.
This space for rent
|
|
|
|
|
Download related source code of OCR using chain but got error exception whenever I click recognize image, somebody should please help...
Thanks
|
|
|
|
|
It's not possible to help you. We have no idea what source code you downloaded, where you got it from, what the exception message is, ... nothing.
Asking questions is a skill. You better learn how to do it.
|
|
|
|