|
Christian Graus wrote: That I'm not trying to co-erce a 5 vote out of you doesn't mean I'm not the one who has your best interests at heart.
Good answer. It coerced my 5.;)
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
*grin*
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
//but without any openDilogFile for choosing file
like this below ,using javascript ,not C#,
html:
<a href="#" onclick="javascript:oEdit.Upload();void(0)">附件</a> |<br />
<input type="file" id="oFile" onchange="javascript:oEdit.OnFileLoad();void(0)" class="hidden" />
js:
function Upload(){<br />
var oEdit = eval(this.ObjUpload);<br />
oEdit.click();<br />
}<br />
function OnFileLoad()<br />
{<br />
var oFile = eval(this.ObjUpload);
var oFileName = oFile.value.substring(oFile.value.lastIndexOf(".")+1,oFile.value.length);<br />
if( oFileName.toLowerCase() != "txt" &&<br />
oFileName.toLowerCase() != "text" &&
oFileName.toLowerCase() != "rar" &&<br />
oFileName.toLowerCase() != "zip" &&
oFileName.toLowerCase() != "bmp" &&<br />
oFileName.toLowerCase() != "jpg" &&
oFileName.toLowerCase() != "jpeg" &&<br />
oFileName.toLowerCase() != "gif" &&<br />
oFileName.toLowerCase() != "png" )<br />
{<br />
this.ObjUploadFile.innerHTML = "<img src=\"Images/oFile.gif\" alt=\"附件\" /> 不允许上传的文件类型![ " + oFileName + " ]";<br />
return ;<br />
}<br />
this.ObjUploadFile.innerHTML = "<img src=\"Images/oFile.gif\" alt=\"附件\" /> " + oFile.value;<br />
}
|
|
|
|
|
Hi,
can anyone explain with example(if can) what is a wrapper class? From my basic understanding, u can use it in order to enable reusability and also if in case in the future, there is a better class, u can just replace it with the new one. However, i'm not quite sure how it works.
Thanks for any reply.
|
|
|
|
|
Wrapper class is an avtivity of migrating non OO types in languages in OO types i.e. in case of C# from basic value types (excepting structs, enums) to class types.
If this is somewhat difficult to consume consider following example.
Say you have one 'int' value which you want to wrap. So you would write a class like:
public class Integer<br />
{<br />
private int var;<br />
<br />
public Integer(int v)<br />
{<br />
this.var = v;<br />
}<br />
<br />
public get(){...}<br />
public set(){...}<br />
}
So now you have wrapped a simple integer into a class Integer which will be an OO type. Fortunately they are directly available in C# libraries.
Now a millon dollar question. What is use of this??
See, when you are going to deal with something which requires complete OO types e.g. object serialization, remoting you need this concept. As the complete manifest information is required in order to perform the activity.
That is it.
Chaitanya Joshi
|
|
|
|
|
No, a wrapper class is typically a class that exists solely to import and expose functionality that is otherwise not available. For example, my article on using the Canon SDK in C# is a wrapper class, the class exposes methods which call the methods in the Canon SDK dlls, via p/invoke. My classes are a wrapper, I do not offer Canon camera connection, simply a way to call a C++ SDK from C#.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I try to explain you my view,
A wrapper class enables reusability because you add an "interface" beetween implementation code and the use of it. If it's well designed, you can change implementation and its impact on use is minimal. If not, you will have to do a lot of changes in use code.
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
y should somebody declare the function or variable as static.what's the advantage
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
|
If you have a static function or variable you do not need to create an object to have access to that function/variable
class X
{
public string nonStatic = "hh";
public static string staticVariable = "xx";
public void NonStaticFunction()
{
..
}
public static void StaticFunction()
{
...
}
}
To have access to nonStatic variable and NonStaticFunction you have to write something like this
X obj = new X();
obj.nonStatic;
obj.NonStaticFunction();
To access the static variable and function you have to write code like this
X.staticVariable;
X.StaticFunction;
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
|
Hi All,
I wan't to compare two SQL Server databases. i.e., I wan't to check both databases structure and add if necessary.
In my project I am using SQL Express database and now we update some fields in the database. So, if we wan't to update the new versions for those customers who are using old database we need to update the database also. It is not recommanded that to manually add the fields in the database and is time taking too. So, I wan't to compare two databases(old and new) and update the fields in the old database.
Any confusion in my question plz let me know so that I can be more clear.
Thanks for any reply,
Narayana Ayyagari.
|
|
|
|
|
There are several commercial packages that does this very well, no free ones I know of. In SQL2005 you can try what is suggested here: http://blogs.geekdojo.net/richard/archive/2007/06/04/134600.aspx[^]
xacc.ide
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
hi ,
this may sound very stupid but i want some body to explain to me what is the difference between
public static void Main()
{
}
AND
public void Main()
{
}
what is the purpose of using void in the main function ie anyway a main function doesnot have to return any values right
expecting a reply at the earliest
j
|
|
|
|
|
Trustapple wrote:
expecting a reply at the earliest
Read this [^] article.
Trustapple wrote: what is the purpose of using void in the main function ie anyway a main function doesnot have to return any values
You use void to let the compiler know that the function doesn't return any values.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
Hi..
Trustapple wrote: public static void Main()
public: It means that this method can be accessed from anywhere....
static: without creating the object of this class we can call the methos directly by using its class name...
void: As this main method is a function it should return something so we specifying void which means that it will not return any value...
main: it is a function name where the program starts executing...you can call this function from any other functions tooo like....
public void callMain()
{
main();
}
Regards,
Sandeep Kumar.V
|
|
|
|
|
I have searched Code project for the articles for programming using MAPI.
But I couldn't find a solution for it.
Can any one give the link or the suggestions to program using Extended MAPI in .NET.
Thanks a lot in advance.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Try this article [^]
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
Hello
Any body know how can I define a const table like this in c#
-----------+------------+--------------+---------------
int_number | int_number | float_number | bool_variable
int_number | int_number | float_number | bool_variable
int_number | int_number | float_number | bool_variable
...
thanks
Beginner in C#
|
|
|
|
|
|
What do you mean by a "const table"?
Constants can only be simple values, like a number or a string. You can's create collecions of objects as constant.
---
single minded; short sighted; long gone;
|
|
|
|
|
I done the rs232 application.Executing is successfully.But showing Unable to open comport.In my application i have open the comport.
|
|
|
|
|
I want to write data received from serial COM port to an Excel data base. I'm really confused abt how to use it. If sumone can help me it'll be really appreciated.
Thank you
|
|
|
|
|
There are several ways to do this. One is presented here [^] which uses Microsoft Excel Object Library. You can also try writing to a CSV file, which is easier, and Excel knows how to open these kind of files or you can try using OleDB or ODBC. You can find the connection string here [^], and if you search on google you will find several tutorials and applications.
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
Thanx alot for the help, it was really useful.
|
|
|
|