|
i have installed the 2002 version of vs.net. i recently installed the .net framework 1.1... will now my vs.net run with the framework 1.1? do i have to remove framework 1.0?
thanks
nhm
|
|
|
|
|
VS 2002 won't run with Framework 1.1.
Free your mind...
|
|
|
|
|
Aaargghh...don't even try that.
1) If you have both frameworks installed, 1.1 is useless, vs.net only runs with 1.0.
2) If you uninstall 1.0 and try running vs.net, it cannot open any project.
3) If you overwrite the SDK with the new SDK for 1.1, vs.net won't find a compiler.
In case 1, you can uninstall 1.1, because vs.net does not recognize it. In case 2 and 3 you have to re-install vs.net 2002.
If you want to use 1.1, you have to use a free IDE (or buy vs.net 2003).
|
|
|
|
|
I'm writing a Windows Service that needs to interact with websites, but of course, Windows Services don't like ActiveX controls or forms being used. The service needs to be able to go to a website, inject values in to fields, command buttons or links to be clicked, etc. I know how to do this using the AxWebBrowser control, but can it be done somehow with the System.Web.WebClient class? Any ideas?
Thanks in advance.
Kyosa Jamie Nordmeyer - Cho Dan
Portland, Oregon, USA
|
|
|
|
|
I'm not exactly sure what you're trying to do, but if you're basically filling out a form on the web site and then submitting it, it's easier to just do the posting directly instead of hosting an AxWebBrowser.
For instance, if the web site has a <FORM> in it, figure out where (URL) the submit button sends the form data, and figure out the names of all the controls on the page (<INPUT>'s). Once you have all of that, use something like the System.Net.WebClient.UploadValues method to post that data to the server and read the response.
If the site requires you to login and it uses cookies for session information, make sure you set up a cookie collection in your original requests to store the cookies you get back.
I once wrote a program that parsed the Project Gutenburg copy of Moby Dick and proceeded to post it chapter by chapter to a "spam" forum that someone created for fun. If you're doing something similar to what I've described (not necessarily spamming, but filling out a form etc.) and have more questions, feel free to respond.
|
|
|
|
|
If the site does require you to login. How do you send the cookie back? The cookie file stored on disk is encrypted. How do you know what values are required to be sent in cookie? Or, is there a method to send back the cookie file stored on disk? Do you think it would work this way?
Thank you.
Sammy
"A good friend, is like a good book: the inside is better than the cover..."
|
|
|
|
|
Take a look at the CookieContainer property on the HttpWebRequest class.
Basically, you start the process by creating a HttpWebRequest. When you get the response back (an HttpWebResponse), it will have a property called Cookies.
On every HttpWebRequest after that, make sure and add those cookies to the CookieContainer property.
In summary, you use HttpWebRequest to post your login credentials however the login form wants it. You get a HttpWebResponse back that has the cookies in it. From there on out, you send those cookies out in every request.
I hope that makes sense...
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
I'm having a wierd issue where i run a query in a thread and the while(Connection.read()) duplicates my results. Anyone else have this issue? For isntance if I have TestTable with the following values:
TestID
1
2
3
It will console.writeline
1
1
2
2
3
3
Below is sample code:
private void button3_Click(object sender, System.EventArgs e)
{
ThreadStart DBThread = new ThreadStart(StartDBDelegate) ;
Thread DB = new Thread(DBThread) ;
DB.Start();
}
public void StartDBDelegate)()
{
Invoke(new UpdateLoadTableDelegate(RunUpdateNow));
}
public void RunUpdateNow()
{
string source =
"server=testserver;uid=testuid;pwd=testpassword;database=TestDB";
string selectconn1 = "SELECT TestID as dbTestID FROM TestTable"
SqlConnection conn1 = new SqlConnection(source);
conn1.Open();
SqlCommand executeconn1 = new SqlCommand(selectconn1,conn1);
SqlDataReader Connection1 = executeconn1.ExecuteReader();
while(Connection1.Read())
{
Console.WriteLine (Connection1[0].ToString())
}
}
I can reduce this menace by doing the following to the while loop, although I shouldnt have to do this...this is really bugging me. It doesnt do this outside of the thread.
string strTestID = "";
while(Connection1.Read())
{
if(strTestID != Connection1[0].ToString()))
{
Console.WriteLine (Connection1[0].ToString())
strTestID = Connection1[0].ToString());
}
}
|
|
|
|
|
hi..can some one tell me is there any case such that when i can write a class having a zero-argument, one-argument and two-argument constructors. Then create only one object of the class such that firstly the two-argument constructor, then one-argument constructor and lastly zero-argument constructor should get called.
if there is, how can i do that? in what scenario do i need to do that?
tks for any help...
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
public class AClass
{
public AClass()
{
}
public AClass(int arg1) : this()
{
}
public AClass(int arg1, string arg2) : this(arg1)
{
}
}
Constructor 1 is called afte constructor 2 is called, and constructor 2 is called after constructor 3 is called.
|
|
|
|
|
You have it backwards, constructor 1 is called before constructor 2, and 2 before 2.
You want:
class Foo {
public Foo() : this("sensibledefaultvalue") {}
public Foo(string arg1) : this(arg1, "otherdefaultvalue") {}
public Foo(string arg1, string arg2) {
}
}
Typically no code is ever added to the first two constructors with this style, they exist only to provide polymophism and default values.
-Blake
|
|
|
|
|
can u pls help me to explain..in what scenario's do we need to do such things???
i mean...is there any case where this is the only way out??
is this kinda stuff common??
never seen anything such as this in my life...
can u pls take some time to explain any such SCENARIOS where above code is DEFINETLY REQUIRED please????
tks a lot...
really appreciate you guys help...
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
It's never required, it is just the most convenient way to express a common idiom.
Often there are several possible optional values that you might accept to control the construction of your object. Equally often, you want to provide more convenient constructors that provide some reasonable default for some or all of those values.
You do this by writing the constructor once, taking all the arguments as parameters. Then you write empty constructors that take fewer arguments, provide the defaults, and pass the call off to the larger constructor.
-Blake
|
|
|
|
|
hi Mr.Blake...
your answer was a bit too technical for me and i didnt really get it....
would u kindly help me a bit more and gimme some links or explanation in simple words where can i use this kinda stuff and where do i need it??
tks a lot...
appreaciate your time and help
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
Another example:
You have a class which describes a task:
public class task {
public task(string name, DateTime date, int priority) {
//DoSomething
}
}
No someone really often creates those objects with Priority 2 but doesnt want to always pass this in. So we declare another constructor
public task(string name, DateTime date) : base(name, date, 2)
{
}
To quickly add tasks we want another constructor to create tasks with Priotity 2 and 'Today' as the date. So we declare another constructor:
public task(string name) : base(name, DateTime.Now)
{
}
Now you have the choice to call the full constructor with all possible arguments, or you just call one of the other constructors to decrease the writing. Another plus is, that you can change the default priority in one place.
Greetings Robert
|
|
|
|
|
Is it possible, using XML/SOAP web services, to perform a 3-way communication, namely, REQUEST, RESPONSE, and ACK?
Client sends the REQUEST, receives the RESPONSE, and send an ACK to the server to acknowledge the receive of the response.
If not, that could be a good project and/or subject of article, do you think?
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Hey,
How to turn off behaviour of TreeView control that if you double click on branch with children than it will expand/collapse? Overriding OnDoubleClick() doesn't work as some other event does collapse/expand.
|
|
|
|
|
I am assuming that the "OnDOubleClick" function you are talking about is a function you implemented as a callback in the parent window class, to process the NM_DBLCLK notification message from the tree control.
This message is sent to the parent window AFTER the tree control finishes its default processing.
You need to subclass the tree control and handle the WM_LBUTTONDBLCK message appropriately.
|
|
|
|
|
Solution de Uberness:
-----------------------------------------------
using System;
namespace UberControls
{
public class TreeViewNonExpanding : System.Windows.Forms.TreeView
{
private bool incomingDoubleClick = false;
protected override void WndProc(ref System.Windows.Forms.Message m)
{
switch( m.Msg )
{
case 0x0203: // WM_LBUTTONDBLCLK
this.incomingDoubleClick = true;
break;
case 0x0202: // WM_LBUTTONUP
this.incomingDoubleClick = false;
break;
default:
break;
}
base.WndProc (ref m);
}
protected override void OnBeforeExpand(System.Windows.Forms.TreeViewCancelEventArgs e)
{
if( incomingDoubleClick == true )
e.Cancel = true;
base.OnBeforeExpand (e);
}
}
}
|
|
|
|
|
I have designed a .Net web service and the client is requesting a new web method to return the web service version number? My web service code consists of the following:
<br />
<WebMethod(Description:="Get Web Service Version Number.")> _<br />
Public Function GetVersion() As String<br />
Dim sValue As String<br />
sValue = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()<br />
Return sValue<br />
End Function<br />
The problem is this returns “0.0.0.0”. I have tried the following in the assembily.vb file with no luck:
<br />
'<Assembly: AssemblyVersion("1.0.*")> <br />
<Assembly: AssemblyVersion("*")> <br />
Can anyone tell me what I’m doing wrong.
Thanks,
Jason W.
|
|
|
|
|
The code you have should work perfectly. AssemblyVersion("*") isn't valid however. I actually got a compiler error when I tried to use it.
The asterisk in the default tells the compiler to automatically increment the version as you build..
1.0.4.3333
1.0.4.3334
...etc...
Use AssemblyVersion("1.0.*") or specify the full version ("1.0.0.0")
If you debug your web service, do you also see 0.0.0.0 returned to string sValue?
|
|
|
|
|
Now why didn’t that work the other day? It works now. Thanks for the help.
Jason W.
|
|
|
|
|
Hi!
The point is that while scrolling within a datagrid, sometimes the gridloses focus with no reason because I was just scrolling.The class below simply illustrates this(while scrolling you'll get a message)
Thank you in advance.
ps: I'm using vs.net 2003.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace test2k3
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dg;
private DataTable dt;
private System.Windows.Forms.Button button1;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
dt = new DataTable();
DataColumn dc = new DataColumn("Nr");
dt.Columns.Add(dc);
for(int i = 0 ; i < 100; i++)
{
DataRow dr = dt.NewRow();
dr[0] = "row #"+i;
dt.Rows.Add(dr);
}
this.dg.DataSource = dt;
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.dg = new System.Windows.Forms.DataGrid();
this.button1 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dg)).BeginInit();
this.SuspendLayout();
//
// dg
//
this.dg.DataMember = "";
this.dg.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dg.Location = new System.Drawing.Point(24, 16);
this.dg.Name = "dg";
this.dg.Size = new System.Drawing.Size(160, 128);
this.dg.TabIndex = 0;
this.dg.Leave += new System.EventHandler(this.dg_Leave);
//
// button1
//
this.button1.Location = new System.Drawing.Point(232, 64);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(56, 32);
this.button1.TabIndex = 1;
this.button1.Text = "button1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(328, 173);
this.Controls.Add(this.button1);
this.Controls.Add(this.dg);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.dg)).EndInit();
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void dg_Leave(object sender, System.EventArgs e)
{
MessageBox.Show("You haven't leaved the grid.You've been just scrolling!","Is This A Bug?");
}
}
|
|
|
|
|
More specifically, the .Leave event is fired when the currently selected cell is scrolled out of view (up or down). Curiously, no Enter event is fired when it is scrolled back in view but a Leave *will* be fired again if you continue scrolling. And in neither case is Got/LostFocus() fired.
I don't usually like to call things bugs in frameworks like this as I usually find the reason or solution as soon as I do.
Depending on what you want to do when focus is lost and gained, I think you can find a pattern of events to identify this situation.
For example, clicking between cells causes: GotFocus, CurrentCellChanged, LostFocus
However in the scrolling scenario: Leave, Validating, Validated
|
|
|
|
|
am i write to say that .NET does not provide any library to directly access any system device. if yes, can anyone tell me how can i access hardware devices using WMI (Windows Management Instrumentation). a short example would be nice.
|
|
|
|