|
i m working on my project.i have 4 columns in msaccess and i have connected these column to c#.now i want to make 4 ranges of each column by taking the diffrence bettten maximum and minimum value of each column.i have doen finding maximum and minimun how can i make ranges in c# using 2D array.
|
|
|
|
|
You could write your own datastructure (class) to represent ranges.
|
|
|
|
|
When an Installation Setup is made in vs2005, what are files created in registry entry while installing that setup, and when uninstalling the setup what are the corresponding files deleted from the registry of that setup.
How to know all these.
Can anyone suggest for knowing about all these things?
Thanks...
|
|
|
|
|
Some registry monitoring applications like this[^] may help.
|
|
|
|
|
|
|
haleemasher wrote: running this code it show an error does not contain definition for row index
At least you should be able to work out from compiler errors. It says, there is no RowIndex property on a GridviewUpdatedEventArgs[^].
2 things to note,
1 - Compile your application before you run. ASP.NET can compile pages on fly, but compiling first is always good.
2 - Post it in correct[^] forum next time.
|
|
|
|
|
Hi,
I need some help. Basically I have a simple HTML form like this:
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br />
<html><br />
<head><br />
<title>Wap Push Test</title><br />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br />
</head><br />
<body><br />
<form name="form1" action="http://111.111.111.111/app" method="post"><br />
xmldata:<br><br />
<br />
<textarea name="xmldata" cols="70" rows="30"><br />
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<PUSH><br />
<UID>myid</UID><br />
<PWD>thepassword</PWD><br />
<CONTENT TYPE="binary"><br />
The content here...<br />
</CONTENT><br />
<DCS>245</DCS><br />
<UDHL>7</UDHL><br />
</PUSH><br />
<br />
</textarea><br />
<br><br />
<input name="" type="submit" value="Push"><br />
</form><br />
</body><br />
</html><br />
Simply, it's only posting the XML to the destination web application. And it's successful.
However, now I need to accomodate that module into a windows application (I'm using C#). This is what I've done:
<br />
string uri = "http://111.111.111.111/app";<br />
<br />
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);<br />
request.Method = "POST";<br />
request.UserAgent = "HTTP CP Client";<br />
request.ContentType = "application/x-www-form-urlencoded";<br />
<br />
StreamWriter writer = new StreamWriter(request.GetRequestStream());<br />
writer.WriteLine(HttpUtility.UrlEncode(strXML));<br />
writer.Close();<br />
<br />
using(HttpWebResponse response = (HttpWebResponse)request.GetResponse())<br />
{<br />
using(StreamReader reader = new StreamReader(response.GetResponseStream()))<br />
{<br />
string ack = reader.ReadToEnd();<br />
ok = true; <br />
}<br />
}<br />
And now I keep getting Internal Server Error.
Has anyone have experienced this before? Why does the HTML form is successful while the windows application generates error?
Thanks & Regards,
Adrian
|
|
|
|
|
excellence80 wrote: writer.WriteLine(HttpUtility.UrlEncode(strXML));
This line looks invalid. Writing the XML data directly won't work. You need to specify the variable name as well. Try something like,
string dataToPost = "xmldata=" + strXML;<br />
writer.WriteLine(dataToPost);
|
|
|
|
|
Navaneeth,
Thanks for the reply. I've tried that, but still giving me "The remote server returned an error: (500) Internal Server Error."
|
|
|
|
|
Oopss... My bad. I messed up the URI value, that's why i got the error.
Just realized it.
Actually your method works fine.
Thanks Navaneeth for the help
|
|
|
|
|
I have not yet manipulated text files so I need some help performing the following tasks:
1. I need to access a letter in a name (eg the 'h' in John)
2. I also need to find the name's position in a list of names (eg Joey is in position 3 here: John, Sally, Joey, Paul)
3. Finally I need to find the length (number of letters) of a name (eg the lenth of Paul is 4)
I am not limited to System.IO, but I am assuming that is the namespace that should be used for these tasks, so if one of these tasks require something not is System.IO then please tell me.
Edit:
The names are in "name1", "name2", "name3" format in the textfile. This might make things easier.
Edit 2:
Never mind I already got it. The trick is to store the file as a string and use the methods in the IEnumerator class.
modified on Tuesday, August 4, 2009 12:53 AM
|
|
|
|
|
System.IO contains nothing to do these things, why should it ?
File.ReadAllText or File.ReadAllLines will read a text file. Then the string class contains everything you need to do this stuff.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Why the hell did you get downvoted for that?
Anyway evened it out a bit
|
|
|
|
|
if names are like the following code(with quote) then you should learn Regular Expression(The 30 Minute Regex Tutorial[^])
string names = "\"name1\", \"name2\", \"name3\"";
and you can get Index of any string in string through IndexOf() , it will return -1 if there is nothing that matches with specified string or char.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
First, use File.ReadAllText to get the file in a string variable and split it on "," to get an array of names. Then you can carry out the other things using methods in string class.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hey all, in my application, I came up with an idea. I want to be able to shake the window to be able to perform a common function that would normally require atleast a few mouse clicks. And depending on how long the user shook the window, the resulting function will differ, accordingly. I've already started coding (The planning stage made it even harder, so I decided to get my hands a little dirty). But the code that I have now, is so cra& that I'm too embarrassed to put it here for everyone to see lol.
Here's what I've trying to accomplish:
Determine whether the user shook, or moved the window.
If shook: then see how long it was shaken for.
if shaken for less than one second: perform function 1.
if shaken for 2seconds: perform function 2.
if shaken for 3seconds: perform function 3.
If the window did not shake, instead it was just moved to another spot, then don't do anything.
I'm not asking for code, but if somebody does know of any tutorials, samples, or articles that may be of help, please do share I have searched on Google etc, and I've only been able to find one article and about 50trillion sites that refer to that one article (and I can't use it since it only work on Windows 7) I've tried it and the bugger just won't work on XP. (or my other computer that runs Vista).
I'd appreciate any help I can get. Thanks everyone.
Regards,
Jason Pezzimenti.
|
|
|
|
|
You want to handle the event when the form moves, and then track movement to determine if it's a shake and use a timer to work out when the shaking stops.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thank you Christian, I had something similar to that, but I didn't use a timer. I'll give your suggestion a whirl and see how things go.
Regards,
Jason Pezzimenti.
|
|
|
|
|
Any notes on the velocity or vigorousness with which the window would get shaken?
As for the checking if it was shaken, you may want to check if the window is within X pixels of it's original location.
ResizeStart and ResizeEnd should work good.
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
Thank you for the advice Ninja-The-Nerd, I'm a little confused as to why I would need to use ResizeStart and ResizeEnd.. Aren't they only for when the form is resized? Or am I wrong about that?
Ninja-the-Nerd wrote: Any notes on the velocity or vigorousness with which the window would get shaken?
Well, The shake needs to be quick. Kind of like when you have to shake a Juice bottle before opening it.
Regards,
Jason Pezzimenti.
|
|
|
|
|
ResizeStart will only fire when the user starts to drag the edges (or you use the keyboard "shortcut" of alt+space, s, and arrow keys) and ResizeEnd fires when the user lets go.
How to determine whether it was a shake or not, I would judge if the average velocity was, um...
If the user was moving it one way then the other then...no, ehh
On reflection it might be wiser to simply check if the window is within, say, 20 pixels of it's start location.
ResizeStart: note the position, start the timer.
ResizeEnd: stop the timer, compare the position, execute the function.
Edit.
In fact, just ignore this.
It's late, I've been coding for several hours. I failed to notice that resize != move.
I'll just get my coat and leave...
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
Hmmm... Good work Ninja! That was very easy to understand and helpful. I'm workiing on it now and will post the code here once I'm done. Thank you
Edit: Hahaha, sounds like you need some sleep :P Thanks for your help anyways, it was much appreciated.
Regards,
Jason Pezzimenti.
|
|
|
|
|
OK sorry for the previous ludicrous suggestion.
I once had a borderless window, and to handle the movement, I had added a button which, when dragged, would take the window with it. I know you're trying to reduce clicks but this could work.
MouseDown:
- set "moving" to true
- store mouse-coords in "lastLoc"
- store window position to "startPos"
- start a timer
MouseMove:
- if moving,
- move window by delta (current location - lastLoc)
- update lastLoc
MouseUp:
- set "moving" to false
- stop the timer
- compare startPos with current position, etc.
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|