|
Thanx, ill have a look at that, i did come across the fact that it was applyin a different session ID when i called my POST.
im storing all the cookies i get (as far as i know) into a global Cookie collection, that seems to have a COOKIE with the name of risessionid, but im not sure what to do with it.(sorry about these, im new to web development)
i also noticed that the Id works fine, as long as the URL of my page doesnt change, i have a page that lists documents, and if u scroll through the list, the page changes but the URL doesnt, but the second i change the URL it doesnt work.
-- modified at 18:43 Wednesday 14th September, 2005
|
|
|
|
|
Its ok now, i managed to get it to work, i jsut simply created a Cookie object and assigned the Session Id cookie to this object, not it all works perfectly, thanx for the help, and pointing me on the right path
thanx
|
|
|
|
|
Hi
I have doen a program, her is some part of the coding
DateTime current = System.DateTime.Now;
DateTime end = DateTime.Parse(textBox1.Text);
TimeSpan ts = current.Subtract(end);
I am calculating as follows. But now i want to know the default format of dateTime.
in texBox1.text, i will give a time.... then that sould be calculated fromteh current time of teh system.
so i want to give only the time like 3:00 ..i mean in hrs and minutes....
so how do i format these.
pls help me to do this .
dhol
|
|
|
|
|
Try this[^]
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi I have done a program using system.threading.timer....
now in that i will input the time in a textbox, say 03:00 pm..
now i have to format in that way, i mean hour:minute..
here is the part of my coding
//system timing
DateTime current = System.DateTime.Now;
//texbox,wher i wil give time
DateTime end = DateTime.Parse(textBox1.Text);
.//then i willcalculate the timespan.
TimeSpan ts = current.Subtract(end);
but only in the second part of my coding. i willgive as 03:00 pm in the textbox,which should be accepted.
so please help me how to format the datetime.
I read from MSDN and articles to use
{t}
, but i dont know exactly how to implement.. so please help me by explaining how to code that part..
js---ie, hour:minute wise...
so that if i give 05:30pm should be able to accept and calculate the timespan.
so please can anyone help me to solve this issue.
js
|
|
|
|
|
Hi
I want to get data from Access instead of notepad.
Here are the codes to get data from notepad by entering IC number (equivalent to ID number). The records are stored in 'Folder'.
<br />
public void btnGo_Click_1(object sender, System.EventArgs e)
{<br />
enable(); <br />
<br />
strFileName2 = tboxEnterICNo.Text;<br />
path = @"Folder\"+strFileName2+".txt";<br />
<br />
if(File.Exists("Folder\\"+strFileName2+".txt"))
{<br />
displaygraph.names = path;
displaygraph.ShowDialog();
}
else<br />
{<br />
MessageBox.Show("File does not exist! Please create a new profile.", "Invalid File Type", MessageBoxButtons.OK, MessageBoxIcon.Error );<br />
}
}
How should i go about to keep the records in Access and also specify retrieving of the queried data from an Access table instead?
I need some help about what to do and how the codes look like.
Thank you very much!
|
|
|
|
|
You've been loading text files, and you want to move to an Access DB ? If you google[^] C# Access Database, you get heaps of links to articles on this sort of thing.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi there,
if u need to keep the records in Access DB, u need to have basic knowledge of mechanism of accessing to Access DB, such as: ODBC, OleDB, ADO or ADO.NET.
u can get more detail and also simple codes from MSDN
To query from Access DB, u also need to know SQL query. This can be got from SQL Book Online
<< >>
|
|
|
|
|
Hi hi,
If it's using oledbadapter and dataset, i know how to use them and query for data from Access.
However, what i need now is how do i automatically store the data downloaded into Access instead of storing in Notepad?
How do i get every set of downloaded data to append to my Access db table??
Thank you!!
|
|
|
|
|
after u downloaded data need to be stored into Access DB, u can use sql query that is something like "insert into ur table(field1, field2,..) values (...)" to insert the data into Access DB
<< >>
|
|
|
|
|
See the FunA() and FunB() result, why any diffent?
<br />
private void FunA()<br />
{<br />
double value;<br />
System.Text.StringBuilder sb = new System.Text.StringBuilder();<br />
for( value = 2.1; value >= -1.1; value -= 0.1 )<br />
sb.AppendFormat("Ceiling({0:f})={1} Floor({0:f})={2} Round({0:f})={3} (int)({0:f}+0.5)={4} Truncate({0:f})={5}\n", value, Math.Ceiling(value), Math.Floor(value), Math.Round(value), (int)(value+0.5), Decimal.Truncate(Convert.ToDecimal(value)));<br />
return sb.ToString();<br />
}<br />
private string FunB()<br />
{<br />
double value;<br />
System.Text.StringBuilder sb = new System.Text.StringBuilder();<br />
for( value = 5.1; value >= -1.1; value -= 0.1 )<br />
sb.AppendFormat("Ceiling({0:f})={1} Floor({0:f})={2} Round({0:f})={3} (int)({0:f}+0.5)={4} Truncate({0:f})={5}\n", value, Math.Ceiling(value), Math.Floor(value), Math.Round(value), (int)(value+0.5), Decimal.Truncate(Convert.ToDecimal(value)));<br />
return sb.ToString();<br />
}<br />
Reuslts is:
FunA():
Ceiling(2.10)=3 Floor(2.10)=2 Round(2.10)=2 (int)(2.10+0.5)=2 Truncate(2.10)=2
Ceiling(2.00)=2 Floor(2.00)=2 Round(2.00)=2 (int)(2.00+0.5)=2 Truncate(2.00)=2
Ceiling(1.90)=2 Floor(1.90)=1 Round(1.90)=2 (int)(1.90+0.5)=2 Truncate(1.90)=1
Ceiling(1.80)=2 Floor(1.80)=1 Round(1.80)=2 (int)(1.80+0.5)=2 Truncate(1.80)=1
Ceiling(1.70)=2 Floor(1.70)=1 Round(1.70)=2 (int)(1.70+0.5)=2 Truncate(1.70)=1
Ceiling(1.60)=2 Floor(1.60)=1 Round(1.60)=2 (int)(1.60+0.5)=2 Truncate(1.60)=1
Ceiling(1.50)=2 Floor(1.50)=1 Round(1.50)=1 (int)(1.50+0.5)=1 Truncate(1.50)=1
Ceiling(1.40)=2 Floor(1.40)=1 Round(1.40)=1 (int)(1.40+0.5)=1 Truncate(1.40)=1
Ceiling(1.30)=2 Floor(1.30)=1 Round(1.30)=1 (int)(1.30+0.5)=1 Truncate(1.30)=1
Ceiling(1.20)=2 Floor(1.20)=1 Round(1.20)=1 (int)(1.20+0.5)=1 Truncate(1.20)=1
Ceiling(1.10)=2 Floor(1.10)=1 Round(1.10)=1 (int)(1.10+0.5)=1 Truncate(1.10)=1
Ceiling(1.00)=1 Floor(1.00)=0 Round(1.00)=1 (int)(1.00+0.5)=1 Truncate(1.00)=0
Ceiling(0.90)=1 Floor(0.90)=0 Round(0.90)=1 (int)(0.90+0.5)=1 Truncate(0.90)=0
Ceiling(0.80)=1 Floor(0.80)=0 Round(0.80)=1 (int)(0.80+0.5)=1 Truncate(0.80)=0
Ceiling(0.70)=1 Floor(0.70)=0 Round(0.70)=1 (int)(0.70+0.5)=1 Truncate(0.70)=0
Ceiling(0.60)=1 Floor(0.60)=0 Round(0.60)=1 (int)(0.60+0.5)=1 Truncate(0.60)=0
Ceiling(0.50)=1 Floor(0.50)=0 Round(0.50)=0 (int)(0.50+0.5)=0 Truncate(0.50)=0
Ceiling(0.40)=1 Floor(0.40)=0 Round(0.40)=0 (int)(0.40+0.5)=0 Truncate(0.40)=0
Ceiling(0.30)=1 Floor(0.30)=0 Round(0.30)=0 (int)(0.30+0.5)=0 Truncate(0.30)=0
Ceiling(0.20)=1 Floor(0.20)=0 Round(0.20)=0 (int)(0.20+0.5)=0 Truncate(0.20)=0
Ceiling(0.10)=1 Floor(0.10)=0 Round(0.10)=0 (int)(0.10+0.5)=0 Truncate(0.10)=0
Ceiling(0.00)=0 Floor(0.00)=-1 Round(0.00)=0 (int)(0.00+0.5)=0 Truncate(0.00)=0
Ceiling(-0.10)=0 Floor(-0.10)=-1 Round(-0.10)=0 (int)(-0.10+0.5)=0 Truncate(-0.10)=0
Ceiling(-0.20)=0 Floor(-0.20)=-1 Round(-0.20)=0 (int)(-0.20+0.5)=0 Truncate(-0.20)=0
Ceiling(-0.30)=0 Floor(-0.30)=-1 Round(-0.30)=0 (int)(-0.30+0.5)=0 Truncate(-0.30)=0
Ceiling(-0.40)=0 Floor(-0.40)=-1 Round(-0.40)=0 (int)(-0.40+0.5)=0 Truncate(-0.40)=0
Ceiling(-0.50)=0 Floor(-0.50)=-1 Round(-0.50)=-1 (int)(-0.50+0.5)=0 Truncate(-0.50)=0
Ceiling(-0.60)=0 Floor(-0.60)=-1 Round(-0.60)=-1 (int)(-0.60+0.5)=0 Truncate(-0.60)=0
Ceiling(-0.70)=0 Floor(-0.70)=-1 Round(-0.70)=-1 (int)(-0.70+0.5)=0 Truncate(-0.70)=0
Ceiling(-0.80)=0 Floor(-0.80)=-1 Round(-0.80)=-1 (int)(-0.80+0.5)=0 Truncate(-0.80)=0
Ceiling(-0.90)=0 Floor(-0.90)=-1 Round(-0.90)=-1 (int)(-0.90+0.5)=0 Truncate(-0.90)=0
Ceiling(-1.00)=-1 Floor(-1.00)=-2 Round(-1.00)=-1 (int)(-1.00+0.5)=0 Truncate(-1.00)=-1
FuncB():
Ceiling(5.10)=6 Floor(5.10)=5 Round(5.10)=5 (int)(5.10+0.5)=5 Truncate(5.10)=5
Ceiling(5.00)=5 Floor(5.00)=5 Round(5.00)=5 (int)(5.00+0.5)=5 Truncate(5.00)=5
Ceiling(4.90)=5 Floor(4.90)=4 Round(4.90)=5 (int)(4.90+0.5)=5 Truncate(4.90)=4
Ceiling(4.80)=5 Floor(4.80)=4 Round(4.80)=5 (int)(4.80+0.5)=5 Truncate(4.80)=4
Ceiling(4.70)=5 Floor(4.70)=4 Round(4.70)=5 (int)(4.70+0.5)=5 Truncate(4.70)=4
Ceiling(4.60)=5 Floor(4.60)=4 Round(4.60)=5 (int)(4.60+0.5)=5 Truncate(4.60)=4
Ceiling(4.50)=5 Floor(4.50)=4 Round(4.50)=5 (int)(4.50+0.5)=5 Truncate(4.50)=4
Ceiling(4.40)=5 Floor(4.40)=4 Round(4.40)=4 (int)(4.40+0.5)=4 Truncate(4.40)=4
Ceiling(4.30)=5 Floor(4.30)=4 Round(4.30)=4 (int)(4.30+0.5)=4 Truncate(4.30)=4
Ceiling(4.20)=5 Floor(4.20)=4 Round(4.20)=4 (int)(4.20+0.5)=4 Truncate(4.20)=4
Ceiling(4.10)=5 Floor(4.10)=4 Round(4.10)=4 (int)(4.10+0.5)=4 Truncate(4.10)=4
Ceiling(4.00)=5 Floor(4.00)=4 Round(4.00)=4 (int)(4.00+0.5)=4 Truncate(4.00)=4
Ceiling(3.90)=4 Floor(3.90)=3 Round(3.90)=4 (int)(3.90+0.5)=4 Truncate(3.90)=3
Ceiling(3.80)=4 Floor(3.80)=3 Round(3.80)=4 (int)(3.80+0.5)=4 Truncate(3.80)=3
Ceiling(3.70)=4 Floor(3.70)=3 Round(3.70)=4 (int)(3.70+0.5)=4 Truncate(3.70)=3
Ceiling(3.60)=4 Floor(3.60)=3 Round(3.60)=4 (int)(3.60+0.5)=4 Truncate(3.60)=3
Ceiling(3.50)=4 Floor(3.50)=3 Round(3.50)=4 (int)(3.50+0.5)=4 Truncate(3.50)=3
Ceiling(3.40)=4 Floor(3.40)=3 Round(3.40)=3 (int)(3.40+0.5)=3 Truncate(3.40)=3
Ceiling(3.30)=4 Floor(3.30)=3 Round(3.30)=3 (int)(3.30+0.5)=3 Truncate(3.30)=3
Ceiling(3.20)=4 Floor(3.20)=3 Round(3.20)=3 (int)(3.20+0.5)=3 Truncate(3.20)=3
Ceiling(3.10)=4 Floor(3.10)=3 Round(3.10)=3 (int)(3.10+0.5)=3 Truncate(3.10)=3
Ceiling(3.00)=4 Floor(3.00)=3 Round(3.00)=3 (int)(3.00+0.5)=3 Truncate(3.00)=3
Ceiling(2.90)=3 Floor(2.90)=2 Round(2.90)=3 (int)(2.90+0.5)=3 Truncate(2.90)=2
Ceiling(2.80)=3 Floor(2.80)=2 Round(2.80)=3 (int)(2.80+0.5)=3 Truncate(2.80)=2
Ceiling(2.70)=3 Floor(2.70)=2 Round(2.70)=3 (int)(2.70+0.5)=3 Truncate(2.70)=2
Ceiling(2.60)=3 Floor(2.60)=2 Round(2.60)=3 (int)(2.60+0.5)=3 Truncate(2.60)=2
Ceiling(2.50)=3 Floor(2.50)=2 Round(2.50)=3 (int)(2.50+0.5)=3 Truncate(2.50)=2
Ceiling(2.40)=3 Floor(2.40)=2 Round(2.40)=2 (int)(2.40+0.5)=2 Truncate(2.40)=2
Ceiling(2.30)=3 Floor(2.30)=2 Round(2.30)=2 (int)(2.30+0.5)=2 Truncate(2.30)=2
Ceiling(2.20)=3 Floor(2.20)=2 Round(2.20)=2 (int)(2.20+0.5)=2 Truncate(2.20)=2
Ceiling(2.10)=3 Floor(2.10)=2 Round(2.10)=2 (int)(2.10+0.5)=2 Truncate(2.10)=2
Ceiling(2.00)=3 Floor(2.00)=2 Round(2.00)=2 (int)(2.00+0.5)=2 Truncate(2.00)=2
Ceiling(1.90)=2 Floor(1.90)=1 Round(1.90)=2 (int)(1.90+0.5)=2 Truncate(1.90)=1
Ceiling(1.80)=2 Floor(1.80)=1 Round(1.80)=2 (int)(1.80+0.5)=2 Truncate(1.80)=1
Ceiling(1.70)=2 Floor(1.70)=1 Round(1.70)=2 (int)(1.70+0.5)=2 Truncate(1.70)=1
Ceiling(1.60)=2 Floor(1.60)=1 Round(1.60)=2 (int)(1.60+0.5)=2 Truncate(1.60)=1
Ceiling(1.50)=2 Floor(1.50)=1 Round(1.50)=2 (int)(1.50+0.5)=2 Truncate(1.50)=1
Ceiling(1.40)=2 Floor(1.40)=1 Round(1.40)=1 (int)(1.40+0.5)=1 Truncate(1.40)=1
Ceiling(1.30)=2 Floor(1.30)=1 Round(1.30)=1 (int)(1.30+0.5)=1 Truncate(1.30)=1
Ceiling(1.20)=2 Floor(1.20)=1 Round(1.20)=1 (int)(1.20+0.5)=1 Truncate(1.20)=1
Ceiling(1.10)=2 Floor(1.10)=1 Round(1.10)=1 (int)(1.10+0.5)=1 Truncate(1.10)=1
Ceiling(1.00)=2 Floor(1.00)=1 Round(1.00)=1 (int)(1.00+0.5)=1 Truncate(1.00)=1
Ceiling(0.90)=1 Floor(0.90)=0 Round(0.90)=1 (int)(0.90+0.5)=1 Truncate(0.90)=0
Ceiling(0.80)=1 Floor(0.80)=0 Round(0.80)=1 (int)(0.80+0.5)=1 Truncate(0.80)=0
Ceiling(0.70)=1 Floor(0.70)=0 Round(0.70)=1 (int)(0.70+0.5)=1 Truncate(0.70)=0
Ceiling(0.60)=1 Floor(0.60)=0 Round(0.60)=1 (int)(0.60+0.5)=1 Truncate(0.60)=0
Ceiling(0.50)=1 Floor(0.50)=0 Round(0.50)=1 (int)(0.50+0.5)=1 Truncate(0.50)=0
Ceiling(0.40)=1 Floor(0.40)=0 Round(0.40)=0 (int)(0.40+0.5)=0 Truncate(0.40)=0
Ceiling(0.30)=1 Floor(0.30)=0 Round(0.30)=0 (int)(0.30+0.5)=0 Truncate(0.30)=0
Ceiling(0.20)=1 Floor(0.20)=0 Round(0.20)=0 (int)(0.20+0.5)=0 Truncate(0.20)=0
Ceiling(0.10)=1 Floor(0.10)=0 Round(0.10)=0 (int)(0.10+0.5)=0 Truncate(0.10)=0
Ceiling(0.00)=1 Floor(0.00)=0 Round(0.00)=0 (int)(0.00+0.5)=0 Truncate(0.00)=0
Ceiling(-0.10)=0 Floor(-0.10)=-1 Round(-0.10)=0 (int)(-0.10+0.5)=0 Truncate(-0.10)=0
Ceiling(-0.20)=0 Floor(-0.20)=-1 Round(-0.20)=0 (int)(-0.20+0.5)=0 Truncate(-0.20)=0
Ceiling(-0.30)=0 Floor(-0.30)=-1 Round(-0.30)=0 (int)(-0.30+0.5)=0 Truncate(-0.30)=0
Ceiling(-0.40)=0 Floor(-0.40)=-1 Round(-0.40)=0 (int)(-0.40+0.5)=0 Truncate(-0.40)=0
Ceiling(-0.50)=0 Floor(-0.50)=-1 Round(-0.50)=0 (int)(-0.50+0.5)=0 Truncate(-0.50)=0
Ceiling(-0.60)=0 Floor(-0.60)=-1 Round(-0.60)=-1 (int)(-0.60+0.5)=0 Truncate(-0.60)=0
Ceiling(-0.70)=0 Floor(-0.70)=-1 Round(-0.70)=-1 (int)(-0.70+0.5)=0 Truncate(-0.70)=0
Ceiling(-0.80)=0 Floor(-0.80)=-1 Round(-0.80)=-1 (int)(-0.80+0.5)=0 Truncate(-0.80)=0
Ceiling(-0.90)=0 Floor(-0.90)=-1 Round(-0.90)=-1 (int)(-0.90+0.5)=0 Truncate(-0.90)=0
Ceiling(-1.00)=0 Floor(-1.00)=-1 Round(-1.00)=-1 (int)(-1.00+0.5)=0 Truncate(-1.00)=0
Ceiling(-1.10)=-1 Floor(-1.10)=-2 Round(-1.10)=-1 (int)(-1.10+0.5)=0 Truncate(-1.10)=-1
Diffrents are showed in bold font.
Why same procedure, only diffrent value of starter, but has many diffrent? Float is so wonder, how can i make it exact.
=== Game is power! ===
|
|
|
|
|
Use double or Decimal, they are more precise.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It already is double!
=== Game is power! ===
|
|
|
|
|
OK, then try Decimal. Floating point isn't precise, that's just how it is. 1.5 + .5 is probably 1.999999, and then casting always rounds down.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You can't make it exact using a floating point data type. A floating poing value is often not exactly the value you specify, as some values can not be represented exactly.
For an example, the value 2.00 might actually be 2.000000000000001, and using Math.Ceiling() on that value will result in the value 3.0.
---
b { font-weight: normal; }
|
|
|
|
|
I see. So that's say I can not get a very exact float value.
But the other question is why the procedure is same, only diffrent between the begining value and loop times, it will make this difrrent.
As you said, every time Math.Ceiling(2.00) must equal 3, but why in FunA() it is equal 2.
They all are called by Math.Ceiling(value) and the value=2.00, the very small gap can not explain this result.
=== Game is power! ===
|
|
|
|
|
.1 cannot be represented in binary, as a result when the 2nd loop should reach the same value the first one starts at, it actually different at the last few decimal places and will either be slightly above, or slightly below the expected value.
|
|
|
|
|
You start at different values. When you get to 2.00, you have made a different amount of adds, so the accumulative error is different. That's why the result differs.
---
b { font-weight: normal; }
|
|
|
|
|
196805 :PrintMon.exe Demonstrates the Win32 Spooler API
If I don't select use printer notication,I can get the monitor information (what I had printed )from network printer.
but if I select use printer notications ,I can't get the monitor information from network printer.
sometimes it show error info is: the handle is invalid(FindNextPrinterChangeNotification)
why?
my operate system is window xp
thanks
-- modified at 21:46 Tuesday 13th September, 2005
|
|
|
|
|
i'm not shure how to go about writing the code for this i need help!!!!!!!
it has 2 group boxes,,,, ,groupbox 1 has name and message labels in it as well as 2 text boxes,
groupbox 2 is directley under groupbox 1,groupbox 2 is labeled (color)
it has 4 radio buttons with red,green, blue ,and black.
it also has a picture box at the lower left corner. and 2 more labels 1 under the pic box and the other to the right of the pic box
|
|
|
|
|
what is the question?
MCAD
|
|
|
|
|
i'm just starting to use c# i'm not shure how to start the code . i know what it should look like but not shure how to put into code...
any help would be apprciated
|
|
|
|
|
Hi,
I am writing an application that needs to "take over" another window that runs a streaming data. I mean, I have a streamer, which shows some data on the screen, and I need to write a program that can read this data from the screen, analyze certain things and then press some buttons on this streamer. My prefference was really to write this in java,(can be in C# though) but I can't find a way or direction as to how I can read or control another application window. Does anyone can please show me at least a hint or refference ? I might add that this should run under windows XP and with administrator authorizations.
Thanks.
|
|
|
|
|
If i understood you correctly you want to achive two things First make two application communicate with each other.Second make one appliaction press buttons in another application if this correct for first use one of Inter-Process Communication like remoting,winsockets...
look at Threads[^]
for the seconed you can achive it using SendMessage windows api an example you can found it Click Buttons in another apllication[^]
second way you can define your custom protocol so let one application to send message to another to call specific method
MCAD
|
|
|
|
|
Hi all
I'm trying to implement a form that can only display one instance at a time. Note that this isn't the first form of the application - I'm not trying to build a single instance app. I just want one of the forms to display only once when a button on the form called at startup is clicked. I've got this working for the most part by implementing it as a singleton but run into problems when the form is closed and I try to open it by clicking the button again. The code I'm using is:
public partial class Singleton : Form
{
private static Singleton instance = null;
private Singleton()
{
InitializeComponent();
}
public static Singleton Instance
{
get
{
if (instance == null)
{
instance = new Singleton();
}
return instance;
}
}
~ Singleton()
{
instance = null;
}
}
I was under the impression that the destructor would resolve the issue I'm having but it hasn't. I receive the following exception:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Singleton'.
Could anyone suggest how I can resolve this issue or suggest another approach to a single instance form that can be launched and closed more than once from the main form of the app?
Thanks in advance
MrR_
Nothing is foolproof to the talented fool.
|
|
|
|