|
I already told you[^] WMI cannot be used to launch an interactive process on a remote machine and what you had to use to accomplish it.
How many times are you going to ask this question in one day??
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
How to pop-up a JPEG file on clicking a Button:
When i click on the Menu items / Button how to load a JPEG file ???
Thanks & regards,
Jayaraman B
Jayaraman B
|
|
|
|
|
Hi.
Where and where from exactly do you want to load a file?
For example, loading to Bitmap you can do like this:
Bitmap bmp = Bitmap.FromFile("C:\\image.jpg");
And you can use it for example to set your Form BackgroundImage property:
this.BackgroundImage = bmp;
|
|
|
|
|
Hi,all
i wanna to making rectangle move above a line as rectangle considered a packet of data
i write some code but it miss the line so if any one know a method for the shape to follow the the line,
i'll be very pleased
thanx in advance
Generator
-- modified at 9:35 Thursday 1st March, 2007
|
|
|
|
|
hi this will be my input string,
"javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(\"OKButton$_Button\", \"\", true, \"\", \"\", false, true))"
can anyone please give me a matching regex for this string.
the values in the bracket changes but the format remains the same...
i tried with this Regex but its not working
string postBackPattern = @"WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions\('(?<target>.*?)', '(?<argument>.*?)', (?<validation>.*?)(?<everythingelse>.*?)\)\)";
please do help me... its urgent
thanks in advance...
|
|
|
|
|
This looks a bit wierd with all those escaped backslashes and quotation marks, but it works fine for me:
javascript:WebForm_DoPostBackWithOptions\(new WebForm_PostBackOptions\(\\\"([^\"]*)\\\", \\\"([^\"])*\\\", (true|false), \\\"([^\"]*)\\\", \\\"([^\"]*)\\\", (true|false), (true|false)\)
or a little different version:
javascript:WebForm_DoPostBackWithOptions\(new WebForm_PostBackOptions\(\\\"(.*)(\\\")??, \\\"(.*)??\\\", (true|false), \\\"(.*)??\\\", \\\"(.*)??\\\", (true|false), (true|false)\)
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I´m trying to validate a xml file against schema... I had to migrate my code from .net 1.1(where I was using XMLValidatingReader and it was working just fine...) to .net 2.0. The XMLValidatingReader became obsolete, so I tried the XMLReader instead, but I always get only the first error... Here is my sample code:
private void validate()
{
XmlSchemaSet xsc = new XmlSchemaSet();
xsc = this.getSchemaToValidate();
XmlReaderSettings xs = new XmlReaderSettings();
xs.ValidationType = ValidationType.Schema;
xs.ValidationFlags = XmlSchemaValidationFlags.ReportValidationWarnings;
xs.ValidationEventHandler += new ValidationEventHandler(ValidationCallback);
xs.Schemas.Add(xsc);
fs = new FileStream("XMLTest.xml", FileMode.Open, FileAccess.Read, FileShare.Read);
XmlReader vr = XmlReader.Create(fs, xs);
while(vr.Read()) {}
}
private void ValidationCallback(object sender, ValidationEventArgs e)
{
tbErrorMessage += e.Message + Environment.NewLine;
this.numberOfValidationErrors++;
}
Can anyone help me with this?
cellardoor
|
|
|
|
|
Have you considered XmlDocument. In 2.0:
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(xmlFile);
xmlDocument.Schemas.Add(xmlSchema);
xmlDocument.Validate(validationHandler);
Seems simpler.
|
|
|
|
|
I can´t use XmlDocument because my xml files are too big(about 80MB) and I don´t want to load the whole xml into memory... I have to read them sequencially, that´s why I use XmlReader.
cellardoor
|
|
|
|
|
I can't tell you - tried a quick test with code identical to yours except that I used Schema rather than schema set and got multiple errors.
Good Luck!
|
|
|
|
|
It looks very similar like examples from MSDN. I am surprised it doesn't work....
I don't really have much experience with "new" xml classes in .NET 2.0 , but did you consider XmlSchemaValidator[^]?
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
Hi friends.
I am cearting my website ... I need "search" in a webform.
for example, when the user types " demo " in the textbox of the search page, then it should appear all the things in all pages of the website,which is correlate with the word "demo".
Just like the search in codeproject.
how can I do it ?
I just know about searching with a specific field,like user name,age,... but I dont have any idea about a word searching ...
is there any articles which can help me?
Or can anyone help me to write ...?
thanks alot.
|
|
|
|
|
Are you searching i a SQL Database?
--
David Trasbo.
|
|
|
|
|
Put "Like" keyword in your select query and pass different parameters i.e syntax may not be write: Select * from Like="AAA",Like"BBB";
|
|
|
|
|
netJP12L wrote: Put "Like" keyword in your select query and pass different parameters i.e syntax may not be write: Select * from Like="AAA",Like"BBB";
sorry I didnt understand ...
What does "like" do ??
What is "AAA" or "BBB" ...?
I want this search form to work with any word...like codeporject's search ...
plz help me
|
|
|
|
|
Yes,Sorry I forgot to say..
My Database is SQLServer 2000
plz help
|
|
|
|
|
You need to set a criteria for how a particular thing will be searched out in your database.
Like is a keyword that tells the query look for something that i am passing in the parameter. Like keyword is different than Equal or ==. As Obvisouly, equal mean look exactly what I need to search.
SELECT *
FROM QUESTION_PARENT
WHERE (PTYPE LIKE 'searchCriteria')
|
|
|
|
|
Is it possible to set xsd-schema during serialization?
The problem is:
1. I have xsd-schema, for example
<<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementformdefault="qualified" attributeformdefault="unqualified">
<<xs:element name="Mass">
<<xs:complextype>
<<xs:sequence>
<<xs:element name="Gross">
<<xs:simpletype>
<<xs:restriction base="xs:decimal">
<<xs:totaldigits value="12">
<<xs:fractiondigits value="3">
<
<
<
<<xs:element name="Net">
<<xs:simpletype>
<<xs:restriction base="xs:decimal">
<<xs:totaldigits value="7">
<<xs:fractiondigits value="4">
<
<
<
<
<
<
<
In this schama two elements are of decimal type, and they have a template for fractional part.
2. Generate class by schema:
public partial class Mass {<br />
<br />
private decimal grossField;<br />
private decimal netField;<br />
<br />
public decimal Gross <br />
{<br />
get {return this.grossField;}<br />
set {this.grossField = value;}<br />
}<br />
<br />
public decimal Net <br />
{<br />
get {return this.netField;}<br />
set {this.netField = value;}<br />
}<br />
}
3. Do the serialization:
public void Test()<br />
{<br />
Mass mass = new Mass();<br />
mass.Gross = 100.1M;<br />
mass.Net = 7.7M;<br />
<br />
XmlSerializer serializer = new XmlSerializer(typeof(Mass));<br />
TextWriter writer = new StreamWriter("res.xml");<br />
serializer.Serialize(writer, mass);<br />
writer.Close();<br />
}
4. Get the result:
<<mass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<<gross>100.1
<<net>7.7
<
The problem is:
I need the elements of decimal type would correspond the template.
That is I need the result as:
<<mass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<<gross>100.100
<<net>7.7000
<
That is I need the elements have the fractional part as indicated in the xsd-schema.
May be it is possible to solve the problem by using special attributes for elements?
Thanks in Advance
Victor
|
|
|
|
|
I pretty sure you need to implement the IXmlSerializable interface to achieve what you want.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
>>I pretty sure you need to implement the IXmlSerializable interface to achieve what you want.
It seems to be that I want!
Thanks a lot!
|
|
|
|
|
I don't think the fractional parts is a requirement but a restriction. 4, 4.0, 4.00, 4.000, and 4.000 would all be valid according to the XSD schema.
If you are really picky add some attributes to the Gross property
System.Xml.Serialization.XmlElement("Gross")
System.Xml.Serialization.XmlType("decimal")
and then modify the property as required (ie return a string)
BTW, I keep saying this because I am an ass but xml elements should be camelCase.
File Not Found
|
|
|
|
|
Surely values 4, 4.0, 4.00, 4.000 would all be valid according to the XSD schema.
But I need formatting according XSD schema
Unfortunately, I can't change the type from decimal to string - type of elements must be decimal.
Thanks for help!
|
|
|
|
|
Changing the type of the property but adding the name and type attributes allows you additional formatting over the type. You can return a string and tell the serializer it is a decimal and it will believe you.
File Not Found
|
|
|
|
|
Yes! It works!
I can't change the type of the values of object Mass,
but I can add other values for serialization only.
As a result, I can use values of decimal type inside my code,
but when I need serialization I will use wrap-properties for my decimal values.
public partial class Mass<br />
{<br />
private decimal grossField;<br />
private decimal netField;<br />
<br />
[XmlIgnore]<br />
public decimal Gross<br />
{<br />
get{return this.grossField;}<br />
set{this.grossField = value;}<br />
}<br />
<br />
[XmlElement("Gross")]<br />
public string GrossAsString<br />
{<br />
get{return Utils.DecimalToString(this.grossField,3);}<br />
set{this.grossField = Convert.ToDecimal(value);}<br />
}<br />
<br />
[XmlIgnore]<br />
public decimal Net<br />
{<br />
get{return this.netField;}<br />
set{this.netField = value;}<br />
}<br />
<br />
[XmlElement("Net")]<br />
public string NetAsString<br />
{<br />
get {return Utils.DecimalToString(this.netField, 4);}<br />
set {this.netField = Convert.ToDecimal(value);}<br />
}<br />
}
public class Utils
{
private const string PATTERN = "########################################.";
public static string DecimalToString(decimal d, int precision)
{
return d.ToString(PATTERN.PadRight(PATTERN.Length + precision, '0'));
}
}
Thanks a lot!
|
|
|
|
|
d.ToString("#.0000") should work with d as a decimal
File Not Found
|
|
|
|