|
I think its time for regular expressions HAHAHHAHA evil laugh from Dr. Evil
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
|
I did something like this in ASP, however it does allow some HTML tags:
Function CleanHTML(html)
Dim re
Set re = New RegExp
re.Global = true
re.IgnoreCase = true
re.Pattern = "[<][<body *>|</body>|<input*>][^<br>][^<b>][^</b>][^<i>][^</i>][^>]*[>]"
CleanHTML = re.Replace(html,"")
Set re = Nothing
End Function
You can fit it to your liking. HTH
Nick Parker
|
|
|
|
|
Does anyone know if there is a problem with using an interface type as the type in the XmlSerializer constructor?
|
|
|
|
|
I doubt it will work... considering that interfaces don't include constructors, and the xmlserializer requires one.
|
|
|
|
|
|
XmlSerializer will not allow typeof(IMyInterface) as its reflected type. Its understandable as XmlSerializer does not use properties but only actual members. I guess this makes sense under the presumption of using get/set value members as interpreted values (ie they are generated from some other value in the class). Uhoh - they expect me to be logical... whats that crap about.
ie
private int mynumber; //serialized
private int myothernumber { //not serialized
get { return mynumber; }
set { mynumber = value; }
}
|
|
|
|
|
Cromwell wrote:
private int mynumber; //serialized
private int myothernumber { //not serialized
get { return mynumber; }
set { mynumber = value; }
}
What the point of a private property, if it is not used? Sure , internal, protected and public have there reason, but I cannot see the purpose of a private property.
Just my 2 cents
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
leppie wrote:
I cannot see the purpose of a private property.
I would use them to wrap other operations that need to be performed when setting the value. Pretty much the same reason you would use any property in the first place
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
leppie wrote:
What the point of a private property, if it is not used? Sure , internal, protected and public have there reason, but I cannot see the purpose of a private property.
1) I was just showing that because an interface cannot define actual member variables only methods, it makes sense that you cannot use them for XmlSerializer.
2) Oh my lordy - really! Private properties are sooo useful. Often over used by lazy (vb6 uhum :P - no offense just hate it) developers, but none-the-less important.
|
|
|
|
|
Hi all,
When you need to pass a struct to an unmanaged function, does the variables need to made public or can they be set otherwise and be accessible only thru there properties.
EG (what i normally do)
public struct Point
{
public int x;
public int y;
}
Can I do?
public struct Point
{
int x;
int y;
public int X {get;set;}
public int Y {get;set;}
}
Will the unmanaged function still function as normal?
Thanx all
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Pretty stupid question I guess.
What would the unmanaged function anyways know about public/private/etc...
This makes life so much more interesting
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
I've created a second windows form in my project, which is a simple dialog which I want to use for 'search and replace' in my text fields. It has a couple of text fields and a few buttons, all created via the wizards. When I create an instance of my dialog, it crashes in the line:
this.ResumeLayout(false);
with a NullReferenceException. I don't see why - I create the dialog using new, and it all seems kosher to me. Does anyone have any suggestions ?
public SearchDialog(bool bReplace, string sText)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
m_sText = sText;
m_bReplace = bReplace;
if (!bReplace)
{
Replace.Enabled = false;
All.Enabled = false;
}
//
// TODO: Add any constructor code after InitializeComponent call
//
}
SearchDialog sd = new SearchDialog(false, m_XMLObject.GetXML());
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
I don't see why that line would cause it to crash, since the code is executed within a non-static constructor the this reference has to exist
Have you installed SP2?
If you haven't, it might actually be crashing on the previous line; but due to a bug (fixed in SP2) it shows the wrong line.
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
James T. Johnson wrote:
If you haven't, it might actually be crashing on the previous line; but due to a bug (fixed in SP2) it shows the wrong line.
That was a bug and i thought that was normal.
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
No, I haven't. The previous line was one that took an array of controls, all of which have had 'new' called on them, and when I comment it out, it still crashes. Basically the Winforms wizards are crap, is my conclusion, as every bit of the code in question was generated by the wizard and none of it was complex.
I gave up in the end, deleted the dialog and did it on the main form.
Thanks for the advice, I'll get SP2 ASAP.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Christian Graus wrote:
Winforms wizards are cra
Yes they are
I just hate getting all that InitializeComponent() junk, plus some random cleanup function I forget the name of. The code is rather inefficient and ugly too! (No tab alignments).
I just use Windows Forms to calculate coordinates then do it myself.
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
Try Stepping through the code and look at the "Auto" window to see what object is null when the exception occurs. Since you haven't posted the code for InitializeComponent() cant't say anything more.
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
Hi,
Atm, i am developing small application, as usual, there is remote object, client and server program which windows based program.
What i'm trying to do is, when I start the client program, (of course I start the server first), the client program will call the remote object, and the remote object will insert a new row in ListView which resides in my server program. The data that I pass is just the IP address.
How can u do this? I don't want to store in database, and ask the server program to retrive new data every 10 secs.. what I want is, remote object tell the server that there is a new data to be displayed.
Thanks
Eka
|
|
|
|
|
It's not quite clear if the server program and remote object are running in the same process or different ones. Anyways i think what you need is to use Remote Events.
Declare an event in the Remote Object which is fired whenever there is new Data. Then make the server program hook onto that event and that will do what you want, i think
Ofcourse i am assuming here that the server communicates with the remote object via remoting as well. You will face problems with Remote Events if you place the server and remote object in different directory.
Refer to the following site before implementing your solution. Look at the Remote Events example.
http://staff.develop.com/woodring
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
how to get point(x,y) where mouse click on desktop window
how to capture mouse events which will tell its position ,what button click etc.
is there any interrupt service of mouse where we can write our procedure ? to get mouse event info?
same for keborad ?
r00d0034@yahoo.com
|
|
|
|
|
please read that code and solve mine problem
tmpProcess = new Process();
tmpProcess.WaitForInputIdle();
tmpProcess.StartInfo.FileName="f:\\mirc59t";
try{
tmpProcess.Start();
while(! tmpProcess.Responding)System.Windows.Forms.Application.DoEvents();
}catch{}
tmpProcess.WaitForInputIdle();
IntPtr hWnd=tmpProcess.MainWindowHandle;
///////////////////////////////////////////////////////////
Control parent = Control.FromHandle(hWnd);
//////////////////////////////////////////////////////////
//Control parent = Control.FromChildHandle(hWnd);
if(parent!=null)
MessageBox.Show("parant not null");
/*foreach(Control child in parent.Controls)
{
IntPtr childHandle = child.Handle;
}*/
///////////////////////////////////////////////////////////
parent variable recive null that's why remaining code could not run.
it should not recive null because the process main window
contain two button and four Static members.
can any body tell why it recive null?
and what i have to do that it should not recive null?
r00d0034@yahoo.com
|
|
|
|
|
I think I had the same problem.
The problem is that you start the process and call process.MainWindowHandle before the Window is created. To test insert a breakpoint after process.Start() and wait for Mirc (hey 6.03 is out ) to open , and continue the code. The only programattical hack i came up with and see in some other code as well is do a Thread.Sleep(100), although this seems a bit clumsy and it doesnt gaurenttee that the handle has been created.
Anyways hope this helps
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
|
Hi,
I don't like to have lots of .jpeg's floating around,
so I would like to neatly tuck them all away into an
ImageList ... but since they are to be used in several
different programs, where do I put them (that is: where do
I put the ImageList) ? - It would be nice to have a
resource file or a .dll where I could access them when
needed, but how ? ... any ideas ?
TIA
- Athos.
PS: Its easy to just put them into every program I make
(into the ImageList), but that would be a huge waste of
space since there are more then 500+ of them and all the
programs that need them are to be in the same package
(meaning they are shiped together) ...
PPS: Still new to the .NET Framework & C#, but I'm getting
there
|
|
|
|