|
How to get notification if one particular file size Exceeds 10 MB. i tried FileSystemWatcher class but it giving Changed event which occur for every change. i want an event to be raise only if file size exceeds some mentioned amount. any help on this.
Thanks
srini
|
|
|
|
|
You can use FileInfo to get the length of the file. If FileInfo.Length bigger then 10MB then you must do something. Otherwise ignore it.
|
|
|
|
|
engsrini wrote: want an event to be raise only if file size exceeds some mentioned amount.
Then you need to create your own component to do this. A good starting place is to wrap a FileSystemWatcher, listen to its events, and when a particular one occurs (in your case a file being created/modified and its size being greater than 10Mb) fire your own event.
---
How to get answers to your questions[^]
|
|
|
|
|
Hi,
I'm trying to overlay some text onto a picture. Because the picture is a real scene, I don't know it's precise colour balance so i cannot pick a colour for the text which can always be seen.
so, i'd like to write text in black with a white border. that is, draw the text in white, then slightly smaller in black, on top of it.
But i cannot find a way of adjusting the font spacing in GDI+. I'm sure it's there, i just don't know where.
Without that, my two draws of text don't align properly.
Anyone know how to do this? or has done it before? or know a better way?
Thanks
Jon
using System.Beer;
|
|
|
|
|
Probably this site can help you:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/_gdiplus_obtaining_font_metrics_usecsharp.asp
|
|
|
|
|
Hi,
I'm just adding halo effects to one of my articles. This is the way to go:
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
GraphicsPath path = new GraphicsPath();
path.AddString("Sample text", base.Font.FontFamily, (int)base.Font.Style,
base.Font.Size * 3, new PointF(10, 10), new StringFormat());
using (Pen pen = new Pen(Color.White, 3))
{
e.Graphics.DrawPath(pen, path);
}
using (SolidBrush brush = new SolidBrush(Color.Red))
{
e.Graphics.FillPath(brush, path);
}
}
|
|
|
|
|
Hi,
I am facing a problem in my web application while i am trying to print an html page, whose url is specified in a textbox, using axWebBrowser component. I am getting an error "Exception of type InvalidActiveXStateException was thrown", at axW.Navigate statement. Please help me to rectify this problem.
private void Button1_Click(object sender, System.EventArgs e)<br />
{<br />
try<br />
{<br />
object empty= null;<br />
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(WebForm1));<br />
AxWebBrowser axW=new AxWebBrowser();<br />
axW.Enabled=true;<br />
axW.Visible=false;<br />
axW.OcxState = (System.Windows.Forms.AxHost.State)(resources.GetObject("axW.OcxState"));<br />
axW.Navigate(TextBox1.Text,ref empty,ref empty,ref empty,ref empty);<br />
axW.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER ,ref empty,ref empty);<br />
}<br />
catch(Exception Ex)<br />
{<br />
Response.Write(Ex.Message.ToString());<br />
} <br />
}
This application is a web application and I want the print at the server end since the server is the user in our case.
If it is not possible to print with this control in a web application, Is there any other way to print an html page without loading it and not to show any print dialog at the user end.
Please help me with this case.
Thanks in advance,
Sai.
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
onload in page write
It may help
vijay jain
|
|
|
|
|
i have 6 textboxes in my form
how will i check if these textboxes doesn't have same inputted values?
i have my own solution but seems to me that my could is quite long.
please help
thanks
|
|
|
|
|
private bool CheckTextBoxes()
{
foreach(Control control in this.Controls)
{
TextBox textBox = control as TextBox;
if(textBox != null)
{
foreach(Control otherControl in this.Controls)
{
TextBox otherTextBox = otherControl as TextBox;
if(otherTextBox != null)
{
if(!otherTextBox.Equals(textBox))
{
if(otherTextBox.Text == textBox.Text)
{
return false;
}
}
}
}
}
}
return true;
}
|
|
|
|
|
Hi, I'd do this:
private bool CheckTextBoxes(params TextBox[] textboxes)
{
bool result = true;
if (textboxes.Length > 0)
{
string standardText = textboxes[0].Text;
for(int i = 1; i < textboxes.Length; i++)
{
if (textboxes[i].Text != standardText)
{
result = false;
break;
}
}
}
return result;
}
Function usage:
bool equality = CheckTextBoxes(textbox1, textbox2, textbox3, textbox4, textbox5, textbox6);
|
|
|
|
|
I would like to be able to receive and send SMS in C#.NET. Please respond with sample or example of how i could accomplish this. I would especially love tutorials which i could read to acquire information/knowledge.
I have been trying to read to see if i could find out exactly how but to no avail. Hence i now seek your assistance.
Looking forward to lots of response.
Man's wisdom is a destructive tool.
|
|
|
|
|
Hello Mr. Unstoppable,
Have u seen this?
regards,
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
Read this article. Hope this helps.
My english is bad. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
|
Hello all, I am developing a touchscreen application. here i want to change windows default scrollbar sizes and messagbox sizes. in windows there are options to change these things (like rightclick on desktop go to DisplayProperties->Appearence->Scrollbar->Size = 36). How can i do this thru program. i am not able to find any APIs for this settings.
Please any one help me on this.
( intially i thought of customizing the scrollbar to big size but this drags me to the wild. late i found it is difficult to do .tats y i comes to this decision)
Thanks and Regards,
Srini
|
|
|
|
|
Try to search for this value in registry.
My english is bad. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
Thats the pretty good solution. Thanks
i am in a LAN so iam not able to use regedit but i got it thru internet saying
Scroll Bar sizes can be changed through the following Registry values:
HKEY_LOCAL_MACHINE\SYSTEM\GWE
Settings:
cxVScr - DWord - Vertical Scroll Bar Width
cyVScr - DWord - Vertical Scroll Bar Button Height
cxHScr - DWord - Horizontal Scroll Bar Button Width
cyHScr - DWord - Horizontal Scroll Bar Height
when normally setting the scroll bar size windows would takes some time to change it appearence. how it would be in my case? suppose if my client system doesn't have privillege to access to registry values how could i do that?
|
|
|
|
|
Firstly, if your app is changing system wide perferences because you think in makes it look better you're going to infuriate lots of people. This goes doubly so if it does so without asking first. As for how you can change registry settings if the user doing the install doesn't have the privleges to do so: They can't. An admin with that privlege would have to do the install.
|
|
|
|
|
Here is the description of the issue:
I am trying to develop an application in C#. Then, somewhere in the application, I will need to send an XML file to .NET Web Service so the Web Service can process the XML and store it in the database.
I couldn't figure out how to send an XML file to .NET Web Service. Does anyone know how to do it?
Any suggestions along with sample code will be appreciated.
|
|
|
|
|
|
you can send as xmlnode object.
InClient
XmlDocument doc = new XmlDocument();
doc.Load(path);
XmlNode cx = doc1.SelectSingleNode("/rootnode");
ret = myser.XmlFile(cx);
In WebService
XmlFile(XmlNode XmlNodePassed)
{
xdo.LoadXml( XmlNodePassed.OuterXml);
}
|
|
|
|
|
HI Friends,
I have a problem regarding, Users of the Computer.
See, i have to find out the User which is currently login with the System through C#.NET
How i am getting to this?
Please if u have a solution then reply this.
|
|
|
|
|
Hi, see Environment.UserName.
|
|
|
|