|
If you want to read from the stream, you have to reset the position in the stream. You don't have to read from the MemoryStream to get the bytes, though, just use the GetBuffer method.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
This is more of a question than a problem. I'll be starting to create a piece of software that will need to be run on a PDA or mobile phone. The question is:
Do i need to code any differently from a windows exe to a mobile device in C#?
The reason for asking is because i've never looked into coding for any type of mobile device before and just wondered are there any major differences etc.
Regards,
Gareth.
|
|
|
|
|
We actually have a mobile development board which might be more helpfull.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
Hello everyone, i want to make a Windows Button Control which i used in any application ,Kindly tell me how i do this as i have no idea how to make controls especially in Windows Application (not for web applications).Guide with some good read materials,website links or any sample test application.
|
|
|
|
|
ruddaba wrote: i want to make a Windows Button Control which i used in any application
Just go to the toolbox, click on the Button control, and drag it to your form. I am assuming you are using visual studio, right?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hi Paul, i dont want to makea general, i want to make a custom ActiveX control (which i used in other applications also by adding the dll of this control). Yes i m using Visual Studio 2005.
plz refer me some good link and help me.
|
|
|
|
|
You did add a reference to your custom ActiveX control, didn't you? You could always add it into the Toolbox so you can drag and drop it onto your form.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
when i click on logout button it does not log me out can some one tell me why is thing doing this. i have a question asp.net c#
when i click logout button i am still login. what i have did made method for logout than called it from lougout button clik event but nothing happens because need to log out in my master page logout button there there for i created in my master page and called it in my master page button ckic event. the code are follow
public void logout()
{
//sandip patel 7/18/2007
//Request.Cookies["memberID"].Expires = DateTime.Now.AddMinutes(20);
//Session["Email Address"] = null ;
//Session["Password"] = null ;
Session.Abandon();
Response.Redirect("Default.aspx");
}
and lougout click event i have call this function logout();
can some one tell me what am i doing wrong please
sandip
-- modified at 21:22 Friday 20th July, 2007
|
|
|
|
|
when i click logout it does not log out
thank you
|
|
|
|
|
I also try to figure it out daku1..i use Session.RemoveAll() in my logout page and redirect it to my login page. But if i push back button in my browser it redirect me to my last page(for example: viewpage.aspx),and in that page i try to push my link page or any button and it tell me must to login first.
Did u already have a session check in all your web pages, that tell user to login first if the session is null?
Regard,
TCim
|
|
|
|
|
I am looking for some help with .chm files and integrating them into my program, does anyone know of an information on this?
|
|
|
|
|
|
assuming your chm file is indexed couldnt you use the help provider class within windows forms 2.0 ?
|
|
|
|
|
Does anyone know of a class that can convert a string in the c# string literal format to a regular .NET string and vice versa? I want to have a designable string property that allows special characters and I figure a TypeConverter that supports the c# string literal format is probably the easiest way to do it, unless there exists a better way?
Thanks
|
|
|
|
|
Maybe some examples of the required conversion would be helpful...
|
|
|
|
|
Say you had a textbox with a property named "WhiteSpaceChars" of type string. Each char in the string is what should be a white space character.
the default value for this string would be (in c# code)
whiteSpaceChars = " \t\r\n";
Now I would like that string to show up in the property designer for users to be able to edit. Now obviously the default string TypeConverter in windows forms can't handle these particular characters. However if I had a TypeConverter that could handle the c# string literal syntax my problem would be solved.
This goes both ways, if the user types in a value of
\x00010
I would like the appropriate string returned to my class as if it were a string literal.
|
|
|
|
|
Hi,
if your only concern is the one backslash/two backslashes issue, you can convert back and
forth with a simple method. I dont think it is provided by .NET, so you would have to
write it yourself (I'll use curly braces to indicate a single char):
say input is ab\tc\nd then output would have to be ab{TAB}c{NEWLINE}d
you can do sequential replacement of \t by {TAB}, then \n by {NEWLINE} etc
using String.Replace
the order is irrelevant, since old and new strings do not conflict with each other.
similar method is required for the other direction.
if you also want to replace the \x#### and \u#### character codes by their actual char,
things become more complicated. Do you ?
|
|
|
|
|
Yeah I think you're right, a tagged expression would be much more easily parsed. Even a {x####} and {u####} could be easily extracted with some simple regexps.
Thanks!
|
|
|
|
|
Hi,
to enable some additional functions for me in my program during developing, I have defined the preprocessor directive "#define debug" at the beginning of each code-file. But it is a bit troublesome to set respectively unset this line on each file when I toggle between release and debug build.
Is there an easier possibility to do this? Can I somehow request in the code wheather it is built as debug or release?
Thanks in advance,
Alex
|
|
|
|
|
Have you looked in the Project Properties, Build tab?? Under General, there's a "Conditional compilation symbols" box where you can put names that will be #defined for the compile. The DEBUG checkbox automatically #defines DEBUG for the entire project compiled under the Debug build configuration. For a Release build, those symbols are removed.
|
|
|
|
|
Friends:
I defined a method with a generic value type parameter as follows, but it does not compile (Operator '-' cannot be applied to operands of type 'T' and 'T'; Operator '>' cannot be applied to operands of type 'T' and 'T').
//Declaration
public class Algos
{
public bool CompValues <t> (T t1, T t2) //the generic sign after CompValues was deleted automatically by the website
{
T dif;
dif = t1 - t2;
if(dif > t1)
return true;
else
return false;
}
}
//Calling
Algos al = new Algos();
al.CompValues<int>(5, 3); //the generic sign enclosing "int" after CompValues was deleted automatically by the website
Whether I add constraints or not :"where T: struct" and/or "where T: IComparable<t>", it does not compile. Why?
Thanks!
-- modified at 14:30 Friday 20th July, 2007
Sheng
|
|
|
|
|
|
Kevin:
I does NOT compile. You can try. Or I have to add some "using" reference?
Sheng
|
|
|
|
|
You might want to re-read Kevin's post. What you want to do, at least how your doing it, isn't possible!
You're assuming that a minus operation is possible on ANY TWO OBJECTS you give this code and that's just not the case. THAT'S what the compiler is trying to tell you! Your code, if it were to compile, leaves open the possibility of
dif = SqlConnection - SqlConnection, which, obviously, isn't valid.<br />
<br />
<br />
<br />
<div class="ForumSig"><small><a href="http://www.codeproject.com/scrapbook/ForumGuidelines.asp">A guide to posting questions on CodeProject</a>[<a href="http://www.codeproject.com/scrapbook/ForumGuidelines.asp" target="_blank" title="New Window">^</a>]</small><br><br />
<font color="Blue">Dave Kreskowiak<br />
Microsoft MVP<br />
Visual Developer - Visual Basic<br> 2006, 2007</font><br />
</div>
|
|
|
|
|
Yes. Did you read the links? It's not compilable. You cannot use operator < with generics. It's a limitation. It's possible with C++ but not with .NET.
Kevin
|
|
|
|