|
A non-capturing group doesn't mean that the pattern isn't matched. It only means that the match does not create a group.
---
b { font-weight: normal; }
|
|
|
|
|
Your right... I corrected the problem in another way.
Thanks
Bruno Conde
|
|
|
|
|
:(Hi, codeprojectors
I edit a "ad.xml" file,the code is below:
-------------------------------------------
<Advertisements>
<AD>
<ImageUrl>images/redcar.gif</ImageUrl>
<TargetUrl>www.csdn.net</TargetUrl>
<AlternateText>red</AlternateText>
<Keyword>1</Keyword>
<Impressions>20</Impressions>
</AD>
<AD>
<ImageUrl>images/bluecar.gif</ImageUrl>
<TargetUrl>www.sohu.com</TargetUrl>
<AlternateText>blue</AlternateText>
<Keyword>1</Keyword>
<Impressions>50</Impressions>
</AD>
<AD>
<ImageUrl>images/greencar.gif</ImageUrl>
<TargetUrl>www.163.com</TargetUrl>
<AlternateText>green</AlternateText>
<Keyword>2</Keyword>
<Impressions>100</Impressions>
</AD>
</Advertisements>
-------------------------------------------
and then I drag a AdRotator in the webform.aspx
I set the "Advertisementfile" property point the "ad.xml",when I run the programme, It doesn't work!!
My Question is:
Because the picture is exsist in my "image\" directory,but they can't show!
(1)Whether I must write some codes in webform.aspx.cs?
(2)What are they looklike ??
(3)Can you show me the Page_Load() source codes??
Thank you very much!!
shanzy
-- modified at 11:03 Thursday 22nd September, 2005
|
|
|
|
|
the error message is below:
---------------------------------
The AdRotator Advertisements found no valid advertisements in the file 'ad.xml'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The AdRotator Advertisements found no valid advertisements in the file 'ad.xml'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): The AdRotator Advertisements found no valid advertisements in the file 'ad.xml'.]
System.Web.UI.WebControls.AdRotator.LoadFile(String fileName)
System.Web.UI.WebControls.AdRotator.GetFileData(String fileName)
System.Web.UI.WebControls.AdRotator.SelectAdFromFile()
System.Web.UI.WebControls.AdRotator.OnPreRender(EventArgs e)
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Page.ProcessRequestMain()
---------------------------------
shanzy
|
|
|
|
|
It's not finding any ad's because you're not using the correct tags. They are:
<?xml version="1.0" ?>
<Advertisements>
<Ad>
<ImageUrl>image1.jpg</ImageUrl>
<NavigateUrl>http:
<AlternateText>Microsoft Main Site</AlternateText>
<Impressions>80</Impressions>
<Keyword>Topic1</Keyword>
<Caption>This is the caption for Ad#1</Caption>
</Ad>
</Advertisements>
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi all
is there any way in C# makes me catch the hotkey (win+D) and override this message to do my own
thx all
|
|
|
|
|
yeah there is, i found this awesome library on planet-source-code.com. I dont exactly remeber the link but run a search for Hotkey and Hot Key and the result will show up. Its really easy use. Use it and save yourself the trouble of reinventing the wheel.
|
|
|
|
|
Do you know how to change windows system time througth c#,c++?
|
|
|
|
|
You need to P/Invoke SetSystemTime and the caller requires the SE_SYSTEMTIME_NAME privilege. By default, only Administrators and Power Users have that privilege on a workstation. See http://pinvoke.net/default.aspx/kernel32/SetSystemTime.html[^] for the P/Invoke signature.
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]
|
|
|
|
|
Do the .net XML classes support the creation of htmlstyle <-- blah blah blah --> type comments? I've tried googling but couldn't figure out how to fliter all the source documentation hits.
|
|
|
|
|
Actually, those are SGML comments - the defining languages for HTML, XML, and others - and are written like so:
<!-- comment --> The exclamation mark is important or it will be treated like an element, but will be invalid.
There is the XmlComment[^] class that represents comments in XML, but what example do you mean by "filter"? Are you trying to get all comments using an XPath expression or what?
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]
|
|
|
|
|
Thank you. Waht I was refering to by filter was that when I googled on 'c# xml comment' all the hits I got were for /// style xml comments in sourcecode.
|
|
|
|
|
is it possible to add a progressbar to a statusbar panel, if yes, how?
|
|
|
|
|
|
I have added a Setup Project to my solution and added several files to the Setup Project.
One of the files that gets installed as part of the installation is required for initial running of the program but once a certain operation is performed that file is deleted and another file of a different name takes over that operation.
The problem is once that file is deleted when I try and run the program again it asks me for my program Installation CD so it can reinstall the deleted file.
How do I stop it wanting to reinstall this file?
Thanks
Paul
|
|
|
|
|
You'll need to define it's containing component as a transitive component. To do this using the Windows Installer project in Visual Studio, select the file and change the Transitive property to True. Then set the Condition property to "NOT Installed". Until the InstallFinalize standard action in a Windows Installer package is executed, the "Installed" property is not defined when installing the product. When repairing the product, however, it will be defined the the component will not cause a prompt for source because the component is no longer needed.
As for your applicatio nasking for the file, more information would be needed. I take it this is a managed assembly? If so, assemblies are published such that when an assembly is missing Windows Installer prompts for the source. Also, if you're launching a shortcut to your application that Windows Installer created, that shortcut forces a consistency check. If you're not starting your program from a shortcut created by Windows Installer, then you need to make sure that you don't have a reference to the one-use assembly in another assembly used by your program. You'll need to load and run code within that one-use assembly using reflection so that a early-bound reference is not created, thus causing a prompt for source.
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]
|
|
|
|
|
i have a checkbox on my form and i have placed the following code:
<br />
private void chkShowLaunchWindow_CheckedChanged(object sender, System.EventArgs e)<br />
{<br />
MessageBox.Show(chkShow.Checked.ToString());<br />
}<br />
why is that the messagebox always displays false. I want the mesage box to show true when the checkbox is checked and false when it is not checked.
|
|
|
|
|
I duplicated this and do not find a problem. It works as you state it should??????
You could look at the CheckState property.......
|
|
|
|
|
funny...i have the code in front of me and it isnt working...i'll see it got some teeny weeny hidden flaw. thanx anyways.
|
|
|
|
|
Is it the chkShow checkbox that triggers the event, then?
---
b { font-weight: normal; }
|
|
|
|
|
Hi
I have to do a program in c# windows application such that form employs with a textbox, Progress bar, label and abutton.
I have used system.threading.timer such that , when a time is given in the textbox, (say 02:30 PM),then the progress bar progress and at last after progress bar finishes, the label which is in the form should turn red colour at that specified time(ie, 02:30 PM)..
but, I had a doen a program to such extent that when a time is given in textbox(say 02:30 pm) then the progress bar progresses and finishes soon and the label turns into red colour. Burt not at the specified time(ie, 02:30 pm)..
here is ,my part of coding. Please help me to do the the thing.
private class ThreadRunner
{
private Form1 _form;
private int _delay;
private System.Threading.Timer _timer;
public ThreadRunner(Form1 mainForm,int delayInSeconds)
{
_form=mainForm;
_delay=delayInSeconds;
}
public void Go()
{
// Create a timer passing in a delegate to the TimerElapsedmethod
// null is to be passed as a parameter to Timerelapsed
//0-start immediately
//10--cal a callback everysecond
_timer=new System.Threading.Timer(new TimerCallback (this.TimerElapsed),null,1000,1000);
while (_timer!=null)
Thread.Sleep(0); // Do nothing until timer has stopped
}
public void TimerElapsed(object o)
{
_delay--;
_form.Invoke(new MethodInvoker(_form.UpdateProgress));
if (_delay<=0)
{
_form.Invoke(new MethodInvoker(_form.UpdateLabel));
_timer.Dispose();
_timer=null;
}
}
}
//then inside teh button click
private void button1_Click(object sender, System.EventArgs e)
{
DateTime current = System.DateTime.Now;
DateTime end = DateTime.Parse(textBox1.Text);
TimeSpan ts = end.Subtract(current);
//value entered in the textbox
int timeToRun= System.Convert.ToInt32(ts.Seconds);
//set the maximum range of value
progressBar1.Maximum=timeToRun;
progressBar1.Step=1;
ThreadRunner tr=new ThreadRunner(this,timeToRun);
Thread t=new Thread(new ThreadStart(tr.Go));
t.Start();
}
this is the coding part which i had done.please explain and tell me wher to change and finish it .
dhol
|
|
|
|
|
From what I can see, this line
dhol wrote:
//value entered in the textbox
int timeToRun= System.Convert.ToInt32(ts.Seconds);
is not providing the correct number of seconds.You will need to add the number of seconds for the hours, minutes and secounds.
//This should work for your needs.
int timeToRun = ((ts.Hours * 60) * 60) + (ts.Minutes * 60) + ts.Seconds;
|
|
|
|
|
I have a contextmenu that is called when you press a button. The contextmenu is associated with a single treeview. however, there are other treeviews on the form. When the user clicks on a different treeview and hits the button that calls the contextmenu for the previous treeview, it gives me an error. i expect this. Nevertheless, I need to fix it. How can I get the contextmenu to show only when the user has selected the designated treeview? Thanks.
D
|
|
|
|
|
Hi There,
I have a C# windows application, that detects system device configuration details, using WMI.
My requirement is to get the Primary Display Driver information, when there are multiple display cards installed on a system.
Can some one help me? Thanks in advance.
Pkonaje
|
|
|
|
|
hi to all,
i am trying to create a balloon for my notifyicon, i have gleaned this from CP tutorial but i can get it going, can anyone help please ?
<br />
private void SMSEventLog_EntryWritten(object sender, EntryWrittenEventArgs e)<br />
{ <br />
ShowNotifyBalloon(NotifyFlags.Info, "SMS Event Monitor", "some sample text", NotifyInfoFlags.Error);<br />
}<br />
<br />
<br />
private enum NotifyFlags {Message=0x01, Icon=0x02, Tip=0x04, Info=0x10, State=0x08}<br />
private enum NotifyInfoFlags {Error=0x03, Info=0x01, None=0x00, Warning=0x02}<br />
private enum NotifyCommand {Add=0x00, Delete=0x02, Modify=0x01}<br />
private enum NotifyState {Hidden=0x01}<br />
<br />
[StructLayout(LayoutKind.Sequential)] <br />
private struct NotifyIconData<br />
{<br />
public System.UInt32 cbSize;
public System.IntPtr hWnd;
public System.UInt32 uID;
public NotifyFlags uFlags;
public System.UInt32 uCallbackMessage;
public System.IntPtr hIcon;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)]<br />
public System.String szTip;
public NotifyState dwState;
public NotifyState dwStateMask;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=256)]<br />
public System.String szInfo;
public System.Int32 dwTimeoutOrVersion;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=64)]<br />
public System.String szInfoTitle;
public NotifyInfoFlags dwInfoFlags;
}<br />
<br />
[DllImport("shell32.Dll")]<br />
private static extern System.Int32 Shell_NotifyIcon(NotifyCommand cmd, ref NotifyIconData data);<br />
<br />
private uint m_id = 0;<br />
<br />
private void ShowNotifyBalloon(NotifyFlags flags, string title, string text, NotifyInfoFlags infoFlags)<br />
{<br />
NotifyIconData data = new NotifyIconData();<br />
<br />
data.cbSize = (uint)Marshal.SizeOf(data); <br />
data.uID = m_id; <br />
data.uFlags = flags;<br />
data.szInfoTitle = title;<br />
data.szInfo = text;<br />
data.dwInfoFlags = infoFlags;<br />
<br />
Shell_NotifyIcon(NotifyCommand.Modify, ref data);<br />
}<br />
it doesnt show the balloon
kind regards,
g00fy
|
|
|
|