|
Hi,
I have a problem. I have a form in c#, with buttons, controlls, textBoxes and others, which I need to rotate 90 degrees. Is this posible in c#?
Can the form be rotated and with it, it's all content, or maybe just the content to be rotated? Buttons, textboxes, checkboxes, labels, can be rotated?
Or maybe this is posible in WPF?
Any ideas?
Thanks!
|
|
|
|
|
I assume you've got a monitor that's mounted at 90 degrees?
A far easier solution would be to use the graphics drivers - most modern nVidia drivers have an option to rotate the desktop so you can mount a monitor in "portrait" orientation
|
|
|
|
|
If you must rotate the form and not the display, i would suggest creating your own controls and handling the paint function yourself. that way you can draw them however you please. in regards to the form, you could remove the form border. and again draw your own window handle where you choose
|
|
|
|
|
Hi Guys,
I am writing an application that logs to a website and read its contents. Log in page of a web i am trying to connect is as follow:
<br />
<html><br />
<head><br />
<script type="text/javascript"><br />
document.cookie="ttAuthInfo=; expires=Sat, 03-Jan-70 00:00:01 GMT";<br />
document.cookie="ttloggedoff=t";<br />
function doSubmit()<br />
{<br />
document.cookie='ttloggedoff=f';<br />
try<br />
{<br />
if (window.parent&&window.parent.opener&&window.parent.opener.document&&window.parent.opener.document.LoginForm&&window.parent.opener.document.LoginForm.ttAuthUID)<br />
{<br />
window.parent.opener.document.LoginForm.ttAuthUID.value = document.LoginForm.ttAuthUID.value;<br />
window.parent.opener.document.LoginForm.ttAuthPWD.value = document.LoginForm.ttAuthPWD.value;<br />
document.LoginForm.RequestURL.value="StdPage&Template=loginformcln";<br />
}<br />
}<br />
catch( er )<br />
{<br />
}<br />
return true;<br />
}<br />
</script><br />
</head><br />
<body><br />
<form name="LoginForm" method="post" action="tmtrack.dll?LoginPage" onsubmit="return doSubmit()"><br />
<input type="hidden" name="RequestURL" value=""><br />
User<input class="frmTxt" type="text" name="ttAuthUID" size="35"><br><br />
Password<input class="frmTxt" type="password" name="ttAuthPWD" size="35"><br><br />
<input type="submit" name="Submit" value="Login"><br />
</input></br></input></br></input></input></form></body><br />
</html><br />
I know that by writing code like following would make it for me:
HttpWebRequest request;
HttpWebResponse response;
CookieContainer cookies;
string url = string.Format("http://site.com/login?.login={0}&passwd={1}", cboUserName.Text, txtPassWord.Text);
request = (HttpWebRequest)WebRequest.Create(url);
request.AllowAutoRedirect = false;
request.CookieContainer = new CookieContainer();
response = (HttpWebResponse)request.GetResponse();
if (response.StatusCode != HttpStatusCode.Found)
{
response.Close();
request.KeepAlive = false;
return;
}
cookies = request.CookieContainer;
response.Close();
request = (HttpWebRequest)WebRequest.Create(http:
request.AllowAutoRedirect = false;
request.CookieContainer = cookies;
response = (HttpWebResponse)request.GetResponse(); using (Stream s = response.GetResponseStream())
{
StreamReader sr = new StreamReader(s);
string line;
while (!sr.EndOfStream)
{
}
Can anyone please tell me in my case what would be url ?
I am new to this; Any help would be appreciated.
Thanks,
AksharRoop
|
|
|
|
|
The URL will be completely dependant upon how the site works. In the example above you are using 2 QueryString parameters of 'login' and 'password'. So, if the site has been created to expect and to handle those parameters then it should work as is. If not, then this approach won't work at all. Another way of doing it would be to programmatically fill in the HttpRequest's Form elements (usually a username textbox and a password textbox) and hand-craft the Request data to be in a manner that the site expects. Doing something like that takes a very in-depth knowledge of Web technologies, specifically the HttpRequest and HttpResponse objects and the HttpRequest's Form values. You're basically doing programmatically what the browser normally does. I've had to do it this way before and it is not an easy undertaking. In my case, I had to use a free Java product called WebScarab while browsing the site normally (in my browser) to capture the Request/Response traffic. Then, I was able to use that information to construct the Request data in exactly the same manner as my browser, but filling in a different username and password. The HttpRequest only takes the request data in binary, so you'll have to take the Request text that you construct (after filling in the username and password) and convert it to a byte[] and that will be the Request data. You also have to take into consideration that you'll be sending the Request to some sort of Login page and that the site will probably redirect to another page if the login is successful. One other small note, when working with the Request data be sure you add the CookieContainer to the Request before you do anything with the Request stream, as I found out the hard way that adding the CookieContainer after closing the Request stream does not produce any kind of error, but the Cookies are not included in the Request and since ASP.NET mostly uses Cookies for SessionID you'll probably get some very unexpected results.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
is there any code that shows transaction history of an sql ldf file.(log file of sql) For example
10.01.2009 12:00:43 transaction=update , old value= george, new value=jack
10.01.2009 12:00:56 transaction=update , old value= marry, new value=hillary
I need also date, do you advice any software i am writing this here because you coders know softwares very well. I used apex sql but it gave some errors. I was adviced luminent log explorer but i couldnt find it. My system is sql server 2005. You can also give me some codes to be used in sql query analyzer.
|
|
|
|
|
|
yes i tried red gate but that was only compatible with sql server 2000 and i am using 2005.in spite of adjusting my database's compatibility level to sql server 2000, it still said "this program only works with sql server 2000 databases" So i need a new one.or an sql code to run on sql analyzer.
|
|
|
|
|
Don't you have any answer?
|
|
|
|
|
hi
I am using windows xp and I am running an application on c#.net.
i want to know the location where temporary files are created for this application?
like if we copy files from one drive to another first temporary files are stored and then they are written in destination drive.
|
|
|
|
|
System.IO.Path.GetTempPath() will give you the current user's TEMP location.
Cheers,
Vıkram.
I don't suffer from insanity, I enjoy every moment of it.
|
|
|
|
|
Thanks its working.
Can we also fine the path of a dump file which is created when error is generated in application?
|
|
|
|
|
Hi,
my report is running fine but when i try to view last page of report through the facility provided by crystalreport viewer it gives an error :-
"Server Error in '/WebSite3' Application.
--------------------------------------------------------------------------------
Error in File C:\DOCUME~1\cna-pbm\LOCALS~1\Temp\report1 {C1AAF9EA-5EEB-4955-A04A-39C97C9B5FDA}.rpt:
Unable to connect: incorrect log on parameters.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Error in File C:\DOCUME~1\cna-pbm\LOCALS~1\Temp\report1 {C1AAF9EA-5EEB-4955-A04A-39C97C9B5FDA}.rpt:
Unable to connect: incorrect log on parameters."
It works if i try to view last page by moving one by one page.
Please reply , if any of you have seen this issue and know the solution.
|
|
|
|
|
|
Hi,
I want to build a mechanism for Scheduling some tasks, and found that Timer class would be a right option, but if my interval is large that is let's say 2 day still Interval need to be in m.seconds?
AddHandler aTimer.Elapsed, AddressOf OnTimedEvent
aTimer.Interval =
aTimer.Enabled = True
Thanks in advance...
|
|
|
|
|
Yes, the interval for a timer has to be milliseconds.
If you want some code to execute every two days then you should perhaps use the windows scheduler instead.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
No i cant go for Windows Scheduler since i use some API mechanisms.
So it will not a be a problem right though i use interval as 2 days in Timer Interval?
Thanks ...
|
|
|
|
|
satsumatable wrote: No i cant go for Windows Scheduler since i use some API mechanisms.
What does that mean? You can create a application which uses all required APIs and schedule the application executable using windows scheduler.
|
|
|
|
|
|
you could still use timer just store the number of minutes (or hours (or days)) elapsed by incrementing it every time the timer ticks.
i.e. if your timer interval is 60000 (60 seconds) you could increment the minute value with each tick and then process that value.
another option is you could store the scheduled time and then when the timer tick event fires every second, for example, you can check to see if the current time matches the scheduled time (or greater than). if so then do your notification code or whatever it is you plan to do.
|
|
|
|
|
The timer will be reset every time your application starts, so if your app might be closed or the computer/server that it's running on may be rebooted it's not going to work without storing the sceduled time somewhere and seeing if that has been reached/passed on restart and setting the timer accordingly.
A better approach would be to store the next scheduled time, and tick your timer every so often (how often depends on how critical the timing of 2 days needs to be) and check against the stored scheduled time in each tick.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Be a programmer and write your own timer class. It certainly isn't hard to do. I'll even help you with a starting point - the class should use a BackgroundWorker object because it can already report progress (which would be the equivalent of a timer tick.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks !! I need to get pitch into the same ...
|
|
|
|
|
satsumatable wrote: I need to get pitch into the same ...
Whatever that means...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
I have a public partial class "con_param_tou : UserControl" (standard userControl)
But i want to inherit or implement a interface of a class that i build.
So i want to maintain the designer mode of standard User Control but i also want to implement or inherit one of my classes.
My class is currently declared as public interface base_param_interface (because I know that i cannot inherit multiple classes... So what I want to do is inherit UserControl and implement one of my interfaces which has a couple of public properties and 2,3 functions...
How do I do that?
Thanks in advance!
|
|
|
|