|
Given the XML file doesn't contain information about the type, you're left to this kind of try/parse thing. When you encounter the variable value, try parsing it as a float, as a bool, and if that doesn't work, store it as a string. To see if a string contains a float or a bool or a ... use the float.TryParse, bool.TryParse, int.TryParse, etc. methods.
|
|
|
|
|
OK!
But in your opinion would it be possible to use the XML Attribute someway?
I try all possible combination with XmlRoot, XmlElement, XmlAttribute but I didn't achieve my goal of having a Serialized output like the one I wrote!
I tried with this, but then I was not able to find a suitable XmlAttribute for value without a tag!
OUPUT on FILE expected
<variable name="FirstVar">value</variable>
MY CLASS that doesn't work
class variable
{
[XmlAttribute]
String name;
}
|
|
|
|
|
Here's an example that will explain what info I'm needing:
"A user has created a cubic bezier curve and wants to add a new point in the middle of that curve."
Once the new point has been inserted, how can I calculate the (now four) control points to keep the original curvature of the line?
If you could rent a programmer a hour and a half for a dollar and a half, how much would he charge for 10 hours?
|
|
|
|
|
http://msdn2.microsoft.com/en-us/library/system.drawing.graphics.drawbezier.aspx[^]
I believe that's built in, if you didn't have that already. I don't know if that'll keep the original curvature on recalculation, didn't get a chance to try it out. Reordering by nearest neighbor may be necessary. Not too sure this will help, but I tried...
Scott
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
Hi All,
I am developing an application where a client has to host a website.
In the sample / examples, this has been made so:
<br />
<br />
Create a socket, bind it to the server's port and listen for client connections<br />
Socket server = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);<br />
<br />
// Wait for a client to connect<br />
Socket clientSocket = server.Accept();<br />
<br />
<br />
// Return a static HTML page back to the client<br />
String s = "<html><head><title>Sample Website!</title></head></html>"; <br />
<br />
m_clientSocket.Send (Encoding.UTF8.GetBytes(s));
As you can see, a very simple website has been sent here.
I however, would like to design my own (much complexer with buttons, links etc.), but donot know how can I send it to the socket then, as it will certainly not fit in a simple string. Plus, it would be very difficult to get the HTML code for a website in a simple string (I dont even know whats a static and dynamic HTML page).
Hence, I request all, if you know of any method to somehow bind a VS2005 site (.aspx) to a socket, please help me.
Thank u all soo much.
|
|
|
|
|
indogerman wrote: Hence, I request all, if you know of any method to somehow bind a VS2005 site (.aspx) to a socket, please help me.
I don't know, but the simple way is to write up your website and then send the files over, not the text within. What your code there does is gets a string then gets the bytes that makes up that string. So it sends bytes rather than the string itself.
So, you open up your web page in a filestream, read some bytes, then send them.
Perhaps like this:
...
Filestream FS = new Filestream("myWebSite.htm", FileMode.Open);
byte[] buffer = new byte[1024];
while(FS.Position < FS.Length)
{
int bytesRead = FS.Read(buffer, 1024);
socket.Send(buffer, bytesRead);
}
It may not be exactly like that, thats just of the top of my head.
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
Hi SKGenius,
Thanks a lot for your prompt help.... your idea was good, and I tried it, but it didnt work. The reason is that I am using the .NET Micro Framework , which really hardly has any classes/libraries (like for file/stream ).
So, I am still looking for a solution to send a Dynamic Webpage (HTML or .aspx) to a Client Socket.
Any Ideas?
Thanks a lot...
|
|
|
|
|
hi,
i've used a program of this site (http://www.codeproject.com/KB/system/usbeject.aspx) for deactivate an hd from an usb port... now i would like to reconnect this hd but in this code i don't try the method... Can you help me?
i explane my problem: i want to create a program that move files from an internal hd to an external hd when the first is full. After, the program had to deactivate the usb port of the external hd so the external hd turn off. When the internal hd is full again the program had to reconnect the usb so the external hd turn on... how i do it?
thanks
ps. excuse me if my english is not perfect
|
|
|
|
|
Joshua82 wrote: now i would like to reconnect this hd but in this code i don't try the method... Can you help me?
AFAIK, you can't do this through code. The drive would have to be powered off and back on again, or unplugged and plugged back it, to get the Device Manager to see it again.
|
|
|
|
|
The way I would do this is using a "Phidgets" Relay board[^] and their .NET API
|
|
|
|
|
...thank you
|
|
|
|
|
i need to port my c#.net application to some machine without dot net framework. i am confused (as per my knowledge, this is not possible).
can anyone help me out? is there any way that i can make it run it without framework installation...any cracks?
(i've developed some console application to be run from commnad prompt)
Ashish Sehajpal
|
|
|
|
|
The only options I'm aware of are commercial (and very expensive) applications.
|
|
|
|
|
money is not any issue...
but the solution must be something by that we need not to install anything on the system of client....
whatever must be installed on my machine...i'll buy somehting(any cost), it must compile my application to some exe format
regards,
Ashish Sehajpal
|
|
|
|
|
I believe Thinstall[^] offer a service where they will wrap up a .net exe with all the required stuff into 1 single executable that can be run on a system without .net installed. It really isn't cheap though:
www.thinstall.com Pricing in North America starts at $4,995 for the Thinstall Virtualization Suite
If it's just a simple console app, you should consider writing it in another language that doesn't require a runtime (c++ maybe)
various versions of the .Net framework are included with various service packs, so it could already be on your client pc's,
Aaron talks about it here[^]
Simon
|
|
|
|
|
developing it some other platform is the only choice i think....
is there any utility that converts c# code into c++ code or runtime ?
Ashish Sehajpal
|
|
|
|
|
Can I ask why you decided to target the .NET framework when the requirements were for an application that does not require this framework? It seems a bit convoluted to me?
|
|
|
|
|
dear...i have developed the application for some other client a long ago....now i do need to deliver it to some other who do not have framework
Ashish Sehajpal
|
|
|
|
|
Hi
I am a newbie to .net. Can anyone please help me to find out a way to read the Mozilla Firefox bookmark list.
thanks in advance
Nandan
|
|
|
|
|
Doesn't it store the bookmarks in a plain text file (HTML I guess). Isn't it?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
renjith p krishnan,
Like Vasudevan Deepak K said, Firefox holds them in a HTML file. So, you'll need to read the file into memory and then iterate through the tags.
If your a newbie, maybe start with something a bit simpler so you get the basic understanding first?
Regards,
Gareth.
|
|
|
|
|
You can find the bookmarks for FireFox in windows contain in the subdirectories of:
%userprofile%\Application Data\Mozilla\Firefox\Profiles\
Be warned that the profile is stored in a subdirectory with random characters, one of them will have a .default (this is the one that loads on application start) and each windows user might have many different profiles for FireFox. So there could be any number of profile subdirectories, but all will contain a "bookmarks.html" file. This file is formated in a custom Mozilla doctype scheme, though it is viewable in a web browser like normal HTML.
|
|
|
|
|
thanks for the reply
so can we make sure that the mozilla profile path will always be as follows?
%userprofile%\Application Data\Mozilla\Firefox\Profiles
Renjith
|
|
|
|
|
Can we store a database in form of XML?
Please excuse me but I don't know XML.
If yes, what if the database is huge? Are there any performance issues related to it?
|
|
|
|
|
ptr2void wrote: Can we store a database in form of XML?
Yes[^], but why would you want to store it in a proprietary format?
ptr2void wrote: Please excuse me but I don't know XML.
Google is your friend, and so is Wikipedia.
ptr2void wrote: If yes, what if the database is huge? Are there any performance issues related to it?
Depends largely on how your design, but generally, if you store it in XML, it will occupy more space. My suggestion is to go with one of the regular databases like SQL server or Oracle.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|