|
Thanks for the tip, but I was hoping for something in C# that I can put in the codebehind in my page.aspx.cs file because I need to access items in my HashTable to display in the message.
|
|
|
|
|
Yep, u can do it in C# code-behind.
Play around with RegisterClientScript (I cannot remember exactly)...
<< >>
|
|
|
|
|
Trying to call a method called tester which will loop round 10 times adding 10 to the val variable...any ideas??
public class tester
{
//fields
public int val;
//method
public tester()
{
for(i=0,i<10,i++);
{
val = "+10";
}
{
return val;
}
|
|
|
|
|
|
is there some kind of AntiVirus/Anti Spyware API that i can use from C#. I have a set of files that I would like to check for virses. Is there a way?
|
|
|
|
|
afaik there are no public libraries to do this in any language. The routines used to do so are very complex and are jelously guarded by the handful of companies that have developed them. Just the routines wouldn't do you any good since you'd also need an upto date database as well.
I'd suggest you investigate existing products to see if they accept commandline execution.
|
|
|
|
|
how can i execute a DOS command through C# and trigger an event once the command has finished executing?
Example: How can i run chkdsk and then truger an event when it finishes
|
|
|
|
|
You do this as you would any process, except that you need to wait until it's finished executing (and optionally get the return code):
using System;
using System.Diagnostics;
class Test
{
static int Main()
{
int ret = 0;
Process p = Process.Start("notepad.exe", "newfile.txt");
using (p)
{
p.WaitForExit();
ret = p.ExitCode;
Console.WriteLine("Process exited with {0}", ret);
}
return ret;
}
}
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi there!
I'm trying to implement SMTP client and I'm having a problem:
I'm trying to use remote SMTP (like outlook) so I'm manipulating with MailMessage.Fields:
"http://schemas.microsoft.com/cdo/configuration/sendusing" = 2 - Remote SMTP
"http://schemas.microsoft.com/cdo/configuration/smtpserver" = "smtp.bezeqint.net"; Remote smtp server
"http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = 25 port
and i have all the time the same exception:
"Could not access "CDO.Message" object. Exception has been thrown by the target of an invocation. The SMTP server name is required, and was not in the configuration source".
Please help me!
evgenyus
|
|
|
|
|
Those are only for the Configuration module and won't work on the Message module itself. The MailMessage class in the BCL does not expose the CDO IMessage.Configuration property, however. What you can do is set the static SmtpMail.SmtpServer property, however, before calling SmtpMail.Send .
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi.
I need to use extended ASCII in my software to cover all the character. Other encoding(Unicode etc) is not an alternative.
My code is as following:
StreamWriter Tex=new StreamWriter(m3uFileName, true, Encoding.ASCII);
I need to be able to use å ä ö etc characters so I need the extended one.
Any suggestions?
|
|
|
|
|
Hi!
I must admit that I've never heard of an "extended ASCII", but there are a few thing you can try nevertheless.
First, you could use Encoding.Defau lt instead of Encoding.ASCII to get the encoding of the current system codepage.
Or, if you know the exact name of the encoding you want, you can use Encoding.GetEncoding(Name) .
Regards,
mav
|
|
|
|
|
ASCII characters are what they are - 7bit characters using codepage 0x4E9F. You can specify a different ANSI code page using Encoding.GetEncoding to specify a code page that contains the character about 127 you want.
The characters above are in the 1250 code page (Western European) so you could use new StreamWriter(m3uFileName, true, Encoding.GetEncoding(1250)) and specify those characters in source as \xe5, \xe4, \xf6, etc.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Tnx. That was what I needed. I only needed to change 1250 code page into 1252 code page and now my application run fine.
If any want to use the 1252 code page take a look here http://www.kostis.net/charsets/cp1252.htm
|
|
|
|
|
Do anybody know how to plot points on a user form I have created?...
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication7
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.GroupBox groupBox1;
///
/// 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
//
}
///
/// 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.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(48, 56);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(48, 32);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(48, 112);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(48, 32);
this.button2.TabIndex = 1;
this.button2.Text = "button2";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(160, 56);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(88, 20);
this.textBox1.TabIndex = 2;
this.textBox1.Text = "textBox1";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(160, 112);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(88, 20);
this.textBox2.TabIndex = 3;
this.textBox2.Text = "textBox2";
//
// groupBox1
//
this.groupBox1.Location = new System.Drawing.Point(24, 16);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(256, 224);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "groupBox1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBox2,
this.textBox1,
this.button2,
this.button1,
this.groupBox1});
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
textBox1.Text = Convert.ToString(2*2);
}
private void button2_Click(object sender, System.EventArgs e)
{
textBox2.Text = Convert.ToString(2*2^3+10);
}
private void Form1_Load(object sender, System.EventArgs e)
{
}
}
}
|
|
|
|
|
X and Y are array list.
Bitmap objBitmap;
Graphics objGraphics=Graphics.FromImage(objBitmap);
if(X.count==Y.count)
{
for(int i;i<= X.Count - 1 ;i++)
{
objGraphics.DrawRectangle(new Pen(new SolidBrush(Color.Red)),Convert.ToInt32(X[i]),Convert.ToInt32(Y[i]),2,2);
}
}
U can take help for this example.
|
|
|
|
|
Can anybody fix this problem??
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication7
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.GroupBox groupBox1;
///
/// 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
//
}
///
/// 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.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(48, 56);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(48, 32);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(48, 112);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(48, 32);
this.button2.TabIndex = 1;
this.button2.Text = "button2";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(160, 56);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(88, 20);
this.textBox1.TabIndex = 2;
this.textBox1.Text = "textBox1";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(160, 112);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(88, 20);
this.textBox2.TabIndex = 3;
this.textBox2.Text = "textBox2";
//
// groupBox1
//
this.groupBox1.Location = new System.Drawing.Point(24, 16);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(256, 224);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "groupBox1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBox2,
this.textBox1,
this.button2,
this.button1,
this.groupBox1});
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
textBox1.Text = Convert.ToString(2*2)+ RAND();
}
private void button2_Click(object sender, System.EventArgs e)
{
textBox2.Text = Convert.ToString(2*2*3^22);
}
private void Form1_Load(object sender, System.EventArgs e)
{
}
// Array of co-ordinates to be plotted
array = [12,23,33,21];
// Plotting loop?
if(X.count==Y.count)
{
for(int i;i<= X.Count - 1 ;i++)
{
objGraphics.DrawRectangle(new Pen(new SolidBrush(Color.Red)),Convert.ToInt32(X[i]),Convert.ToInt32(Y[i]),2,2);
}
}
}
}
|
|
|
|
|
hi
this is part of the code causing the problem:
XmlNodeList l = outputcopy.SelectNodes("//" + tagname);
foreach (XmlNode nod in l)
{
XmlNode parent = nod.ParentNode;
if (parent == null)
{
//break here
}
}
Whenever I try this the last node in the node list appears not to have a parent, even when its not the root node. Whay is this?? I'm totally stumped.....
cheers
|
|
|
|
|
It would be helpful to see the Xml file that you're querying in order to figure out what's wrong...
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|
|
Sorry, the xml is:
<xml>
<multiply>
<variable name="x" />
<variabel name="x" />
</multiply>
<symbol>=</symbol>
<multiply>
<number>2</number>
<number>5</number>
</multiply>
</xml>
and tagname is "multiply"
cheers
|
|
|
|
|
|
Hi,
maybe somebody know how i can read IPTC from image file?
Greetings
|
|
|
|
|
Hi everybody!
I have a question to do:
how can i download the HTML code of an internet page, and save it in .txt?
help me plz...
|
|
|
|
|
|
i need the code of an internet page i put in input...all ways are allowed!
|
|
|
|