|
Yeah, sorry divisable.
Well the keys are next to each other arn't they?
|
|
|
|
|
Hello, I have a problem and may be you can help me. I've a DLL in a WS and the same DLL in a winform. I need to invoke a WS method that return for example a Person object, from the winform. The problem is that it can't convert the WS.Person to the DLL.Person. How can I convert that type? I try to cast but I still the errors.
Thanks a lot !!
|
|
|
|
|
What error do you get?
Vitaliy Tsvayer
Tikle
|
|
|
|
|
The error is Cannot convert the type WS.Person to Dll.Person
|
|
|
|
|
|
Well, first let me explain the reason of this problem.
When you add WebReference to the WebService, proxy class is created with all the types that come from WSDL(generated by ASP.NET for your WebService). BUT, although generated classes have the same fields as your original class from DLL, they are abolutely different entities, that is why you cannot cast from WS.Person to DLL.person for instance.
One of the solutions would be to modify the generated proxy class so that return type of the WebService method is the class from your shared DLL and not generated one. You need to modify Reference.css under Web References.
Another solutions is to write code that takes WS.Person class and creates new DLL.person class by copying all the fields, etc. You could use reflection to shorten the code as all field names are the same in both types.
Maybe there are more elegant solutions, but hope this helps.
Vitaliy Tsvayer
Tikle
|
|
|
|
|
Hi,
In the Font object I can see no way to retrieve the filepath for a font. (I need to do this as some third party loads fonts from the filepath).
My knowledge of the Win32 API is very scratchy. Is there anyway I can retrieve the filepath for a font in .NET or is there a method on the Win32 API I can invoke to retrieve this information.
Thankyou
|
|
|
|
|
string fontpath = Environment.SystemDirectory.Replace(@"\system32", "") + @"\Fonts";
|
|
|
|
|
I want to modify the split container to add a button to the
splitter and to alter the shading of the bar but I can not find any
information on this topic Help?
Bob
|
|
|
|
|
Hi All,
I have created a custom datagridviewColumn control containig a TextBox+Button. I want to access the events of these controls directly, for example TextBox_textChanged, Button_MouseHover.i have found that In DataGridViewButtonColumn we have to access the button through Cell_Click event, but this doesn't resolve my problem. Can someone please tell me how to access the events of controls contained in DataGridViewColumns?
Thanks
sorry for my bad English.
|
|
|
|
|
Hello
If you've created that custom control then you control its events. You can do this in two approaches:
1- Make a custom event in your custom control. Handle whatever events you want to handle of the button and textbox private inside your control. From these handlers, fire the public event. Now handle that public event in your form.
2- Just declare your button and textbox as public members of your control. Then you will have access to their events as well. Programatically only of course -ie. you may not access their events using the PropertyGrid by default-.
Regards
|
|
|
|
|
Hi there,
I'm writing an XHTML site and i'm using FreeTextBox to do it, unfortunately is has a nasty habbit of breaking XHTML rules with upper case tags and removing closing slashes from image tags.
Now i've written a function which fixes allot of HTML errors which it (or the user) may create. The functionalitu i'm missing is a regex which will turn
<img src="foo" alt="foo" title="foo" anyotherattribute="anyother value" >
into
<img src="foo" alt="foo" title="foo" anyotherattribute="anyother value" />
Can anyone supply a regex replace pattern which will do this?
This is my function so far in case anyone else finds it useful.
public static string MakeHTMLValid(string strInput)
{
strInput = Regex.Replace(strInput, "<P>", "<p>");
strInput = Regex.Replace(strInput, "</P>", "</p>");
strInput = Regex.Replace(strInput, "<EM>", "<em>");
strInput = Regex.Replace(strInput, "</EM>", "</em>");
strInput = Regex.Replace(strInput, "<DIV", "<div");
strInput = Regex.Replace(strInput, "</DIV>", "</div>");
strInput = Regex.Replace(strInput, "<IMG", "<img");
strInput = Regex.Replace(strInput, "<LI", "<li");
strInput = Regex.Replace(strInput, "</LI>", "</li>");
strInput = Regex.Replace(strInput, "<H1>", "<h1>");
strInput = Regex.Replace(strInput, "</H1>", "</h1>");
strInput = Regex.Replace(strInput, "<H2", "<h2");
strInput = Regex.Replace(strInput, "</H2>", "</h2>");
strInput = Regex.Replace(strInput, "<H1 class=HeadingOne>", "<h1 class=\"HeadingOne\">");
strInput = Regex.Replace(strInput, "<P class=MsoNormal>", "<p class=\"MsoNormal\">");
strInput = Regex.Replace(strInput, "<UL", "<ul");
strInput = Regex.Replace(strInput, "</UL>", "</ul>");
strInput = Regex.Replace(strInput, "<BR>", "<BR />");
strInput = Regex.Replace(strInput, "<BR />", "<br />");
strInput = Regex.Replace(strInput, "<BR>", "<br />");
strInput = Regex.Replace(strInput, "<br>", "<br />");
strInput = Regex.Replace(strInput, "class=normalText", "class=\"normalText\"", RegexOptions.IgnoreCase);
strInput = Regex.Replace(strInput, "</A>", "</a>");
strInput = Regex.Replace(strInput, "<HR>", "<hr />",RegexOptions.IgnoreCase);
strInput = Regex.Replace(strInput, "<A ", "<a ");
strInput = Regex.Replace(strInput, "<SPAN", "<span");
strInput = Regex.Replace(strInput, "</SPAN>", "</span>");
return strInput;
}
"Gödel proved that any formal system that defines the primitive recursive functions must be either incomplete or inconsistent. In particular one could not prove from within the system that the system itself was consistent even though the question could be formulated within the system."
|
|
|
|
|
Parsing nested tags with regular expressions is not a trivial task, but for the tag it should work fine:
string to find: <img(?<content>[^>]+)>
string to replace: <img${content} />
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks for that it worked like a charm
"Gödel proved that any formal system that defines the primitive recursive functions must be either incomplete or inconsistent. In particular one could not prove from within the system that the system itself was consistent even though the question could be formulated within the system."
|
|
|
|
|
Is there anything within the 1.1 framework that can do this automatically? The Delete() methods of Directory and Path both specify that they only work on empty folders.
|
|
|
|
|
How about:
Directory.Delete(@"C:\MyDirectory", true);
|
|
|
|
|
dan neely wrote: both specify that they only work on empty folders.
IIRC, they work only if the folder is writeable or is empty. Folders are typically writeable, so you shouldn't have any problems.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Dumbest. Movie. Title. Evaaar.
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Hi,
I've got another question: I'm working with Visual C#.NET 2003 to make a web application, do you know a way to remember a user password? Like Websites do when they propose a checkbox: "remember my password?". Do you know how to do this in C#.NET?
Thanks,
Oren.
|
|
|
|
|
Save it as session variable or as cookies.
|
|
|
|
|
Hi Guys,
I use Visual C#.NET 2003 to build a Web Application. Now a problem is: when we run the application, an internet window is opened at a standard size. I'd like to have it opened "maximized" (taking all the screen size).
Does anybody know how to do this?
Thanks,
Oren.
|
|
|
|
|
Hi!
I think you'll have to execute some JavaScript code in the Load event of your web page, something like
window.moveTo(0,0);<br />
window.resizeTo(screen.width,screen.height);
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hi
Does somebody know if it is possible to display animated gif in a cell in DataGridView and how to do it?
Thanks
Ela
|
|
|
|
|
what is the code for finding the square root of a number?
tony-yeyo
|
|
|
|
|
|
thanks man.
take care.
tony-yeyo
|
|
|
|
|