|
hi, thanks alot for your help it helped me, i would like to ask u for another help if u can, i want the code that help me save the email message as msg file format as we can do through the outlook
Thanks alot
Hamody
|
|
|
|
|
|
m looking for a code that zip a folder not just a file as a site code gives, and i would like to ask u for another help if u can which is how i can save email message as msg file format i need a code man so could u plz plz help me
Thanks alot
Hamody
|
|
|
|
|
hi all,
i am new to c#, so need some help in programming. i have few queries. if u can then plz solve it for me.
1.Console application: App should accept input as path of a text file and search string from user and display lines containing search string on console or should write in another text file based on the parameters passed.
2.Win form application: App should accept input from user and create XML file with these values. If an existing XML file is provided it should validate and displays controls as per the XML and populates them with values specified in the XML.
3.Win form application: Should use XML for reference numbers and values as template and search for these reference numbers in a text file [containing reference numbers with values] and update the results of comparison in a data base.
s.mahakul
|
|
|
|
|
sragabart wrote:
1.Console application: App should accept input as path of a text file and search string from user and display lines containing search string on console or should write in another text file based on the parameters passed
Your probably looking for FileStream and some of her derivatives. If you want to know how to make a console application just click console application when you start visual studio (Under the assumption thats what your using).
If your looking to accept input you can either pass them as extra paramaters from the console (This is the same as most languages where the main function takes an array of strings) or you can use something like System.Console.ReadLine();
sragabart wrote:
2.Win form application: App should accept input from user and create XML file with these values. If an existing XML file is provided it should validate and displays controls as per the XML and populates them with values specified in the XML.
3.Win form application: Should use XML for reference numbers and values as template and search for these reference numbers in a text file [containing reference numbers with values] and update the results of comparison in a data base.
This is probably going to be very similar. Your going to want some xml serialialization (I'm probably wrong to call it that) so considering reading that.
I hope I've at least given you a start, please ask me if I can help more!
|
|
|
|
|
Smells like homework around here
come back with real problems where ur stuck and ask for help, but dont expect anybody to write your entire code...thats your job.
|
|
|
|
|
This stinks of homework!
sragabart wrote:
if u can then plz solve it for me
Are you joking? This is YOUR homework, not ours! We don't get paid to do this either. What's the point of taking a class if your not going to do the work to pass it?!
You're going to have to write these applications yourself. Use the materials that were covered in the class up to this point and at least TRY to hack something together. When you get stuck, then you can call us to help you out with specific problems.
Asking us, or anyone else for that matter, to "solve/write this for me" is just plain rude.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i want to acess to WinIoCtl.h
typedef enum _STORAGE_MEDIA_TYPE how do i do it ?
|
|
|
|
|
Simply declare it:
<br />
private enum _STORAGE_MEDIA_TYPE {<br />
<br />
DDS_4mm = 0x20,
MiniQic,
Travan,
QIC,
MP_8mm,
AME_8mm,
AIT1_8mm,
DLT,
NCTP,
IBM_3480,
IBM_3490E,
IBM_Magstar_3590,
IBM_Magstar_MP,
STK_DATA_D3,
SONY_DTF,
DV_6mm,
DMI,
SONY_D2,
CLEANER_CARTRIDGE,
CD_ROM,
CD_R,
CD_RW,
DVD_ROM,
DVD_R,
DVD_RW,
MO_3_RW,
MO_5_WO,
MO_5_RW,
MO_5_LIMDOW,
PC_5_WO,
PC_5_RW,
PD_5_RW,
ABL_5_WO,
PINNACLE_APEX_5_RW,
SONY_12_WO,
PHILIPS_12_WO,
HITACHI_12_WO,
CYGNET_12_WO,
KODAK_14_WO,
MO_NFR_525,
NIKON_12_RW,
IOMEGA_ZIP,
IOMEGA_JAZ,
SYQUEST_EZ135,
SYQUEST_EZFLYER,
SYQUEST_SYJET,
AVATAR_F2,
MP2_8mm,
DST_S,
DST_M,
DST_L,
VXATape_1,
VXATape_2,
STK_9840,
LTO_Ultrium,
LTO_Accelis,
DVD_RAM,
AIT_8mm,
ADR_1,
ADR_2, <br />
STK_9940
}<br />
_________________________________
Vote '1' if you're too lazy for a discussion
|
|
|
|
|
lol so simple
thanks
|
|
|
|
|
big noob problem
i've got that
public enum W32_DriveTypes : int
{
Unknown = 0,
NoRootDirectory = 1,
Removable = 2,
LocalDisk = 3,
NetworkDrive = 4,
CompactDisc = 5,
RAMDisk = 6
}
and for my switch to wroks i need to put (int) in front ... ?!
switch( int.Parse(mo["DriveType"].ToString()) )
{
case (int)W32_DriveTypes.Removable : idxicon = 8; break;
case (int)W32_DriveTypes.LocalDisk : idxicon = 4; break;
case (int)W32_DriveTypes.NetworkDrive : idxicon = 6; break;
case (int)W32_DriveTypes.CompactDisc : idxicon = 5; break;
case (int)W32_DriveTypes.RAMDisk : idxicon = 7; break;
default: idxicon = 0; break;
}
|
|
|
|
|
The C# compiler does not understand that the Enum got a type.
You can save a few cast operations like that:
W32_DriveTypes driveType = (W32_DriveTypes) int.Parse(mo["DriveType"].ToString());
switch( driveType )
{
case W32_DriveTypes.Removable : idxicon = 8; break;
case W32_DriveTypes.LocalDisk : idxicon = 4; break;
case W32_DriveTypes.NetworkDrive : idxicon = 6; break;
case W32_DriveTypes.CompactDisc : idxicon = 5; break;
case W32_DriveTypes.RAMDisk : idxicon = 7; break;
default: idxicon = 0; break;
}
_________________________________
Vote '1' if you're too lazy for a discussion
|
|
|
|
|
Hi
I was wondering if anyone familiar with the workings of the .NET TcpClient and TcpListener classes could help.
The problem is that closing TcpClient connections doesn't actully seem to close them, according to the performance counter "NET CLR Networking -- Connections Established": the count just gets higher and higer - it doesn't even come down when I restart the applications
Now, for a simple test case, I have a server component with TcpListener:
TcpListener listener = new TcpListener(PORT);
TcpClient client;
for (;;)
{
if (listener.Pending)
{
client = listener.AcceptTcpClient();
Console.WriteLine("Connection established");
client.Close();
}
}
A client opens up a connection, sleeps for one second and then closes it.
On a live system, as the connection count gets higher, the data transfer rate gets lower and lower until it eventually stops and the W2K workstation has to be restarted.
Any ideas on how I can fix this and force these connections to close?
thanks
ehuysamer
|
|
|
|
|
If you call TcpClient.GetStream(), you also need to close the Stream in addition to the TcpClient.
|
|
|
|
|
I'm having some inconsistency problems with my deployment project ("Setup") and its custom actions ("Installer"). I'm using Visual Studio .NET 2003 (.NET 1.1, no service pack) on Windows XPSP1.
My main project is a band object (Explorer Bar) in an assembly (.DLL) that needs to be registered on installation and unregisted on uninstallation. In addition, during installation, Setup creates registry subkeys, sets registry values, installs some application files, and adds a new file-type. On uninstallation, Setup is supposed to undo all of that. More specifically, I have custom actions for Setup that are run within the Installer class. The Installer class is within the main assembly, and perhaps surprisingly, that seems to work, some of the time. I have also tried putting the Installer class in its own assembly, both as a class library and as a console application, and that doesn't seem to work any better than having the Installer class in the main assembly. Sometimes the registration or unregistration of the main assembly fails. The workaround we tell our users (a small userbase so far, fortunately) is to "repair" after installation, or to uninstall completely before installing a new version. Neither are as ideal as being able to simply install over the previous version. I think there are two subproblems.
1) The Uninstall custom action in the Installer class isn't always called. This is especially inconsistent. My Installer class overrides OnBeforeUninstall() [so that the main assembly is unregistered before the files are removed] and Uninstall() [so that savedState is empty, in order for the installState to be removed]. Lacking better debugging tools for MSIs, I added code in these methods to set registry entries containing the timestamp at the beginning and end of each of these methods. I verified that usually the Uninstall custom action is (but not always) called when the user explicitly asks to remove the package (via "Add/Remove Programs"), but when the user is installing over a previous version, sometimes (but not always) the Uninstall custom action is called. As a side note, I change the installer version, PackageCode, and ProductCode whenever I build a new installer. I don't understand why these inconsistencies occur. For a while I thought VS.NET might randomly corrupt the Setup.vdproj file and that I'd have to remove and add the custom actions again, in order to be sure that the Uninstall custom action was registered, and once or twice I built the Setup.vdproj file from scratch, fearing general corruption in the file. This seemed to help (especially the latter), but not for too long, and it's not a sustainable solution, even if it's not a placebo. In addition, which may or may not be related, the Setup.MSI doesn't seem to always uninstall all registry entries, and because of that, I've had to add a few lines to my Uninstall custom action. It doesn't seem right to me that the MSI would sometimes not uninstall registry entries that it added in the first place.
2) The second subproblem is more specific to my project, and this occurs sometimes when I'm registering the main assembly. The main assembly is registered in the overridden OnCommitted() method of the Installer class, presumably after the previous version's main assembly was unregistered in the OnBeforeUninstall() method. In the case where the previous version and the new version were installed in the same "Program Files" folder, the assembly containing the Installer class will have the same exact CodeBase, but they'll of course have a different FullName because the assembly version has been automatically incremented. It seems that sometimes the Commit custom action will re-register the old assembly instead of registering the new assembly. My registration code looks like this:
RegistrationServices rs = new RegistrationServices();
rs.RegisterAssembly(MyAssembly, AssemblyRegistrationFlags.SetCodeBase); and my unregistration code looks like this:
RegistrationServices rs = new RegistrationServices();
rs.UnregisterAssembly(MyAssembly); MyAssembly is defined as a property:
Assembly MyAssembly
{
get
{
return Assembly.LoadFile(InstallDirectory + "assembly.dll");
}
} I used to use Assembly.Load(path) instead, but it seemed that Assembly.LoadFile(path) worked better. My concern is that either the Uninstall and Commit custom actions share an AppDomain, so sometimes MyAssembly might return the previous assembly during the Commit phase if the previous assembly wasn't somehow still in Commit's AppDomain after Uninstall finished. I tried creating a temporary AppDomain and then loading the assemblies within that, but it threw a deserialization exception. I suppose the overall issue of this subproblem is that I'm trying to register and unregister assemblies without knowing the FullName of either assembly, as I'm trying to semi-automate the build process and stay within VS.NET as much as possible (for now).
I know these are complex and possibly peculiar problems! While I'd love for someone to post a solution for either (or both!) subproblems, at the very least, I'd appreciate hearing tips regarding debugging deployment projects and custom installation classes, similar stories of installer woes and solutions, and recommendations for possibly better installation/deployment tools than VS.NET's deployment projects. Something like InstallShield seems like overkill, but maybe it's what I need to have dependable installations.
Thanks for reading this far!
Arun
|
|
|
|
|
sorry my English is bad
DataSet ds=new DataSet();
IDbDataAdapter ida=helper.GetDataAdapter();
ida.MissingSchemaAction=MissingSchemaAction.AddWithKey;
ida.SelectCommand=helper.CreateCommand(conn,"select * from A;select * from B",CommandType.Text,null);/////////this row code CommandString error,what?
ida.Fill(ds);
i use access database
i think create many table of dataset
|
|
|
|
|
xiaoyuan wrote:
helper.CreateCommand(conn,"select * from A;select * from B",CommandType
IIRC, Access/Jet SQL doesn't support compound statements. Try breaking them up into two different calls:
ida.SelectCommand=helper.CreateCommand(conn,"select * from A",CommandType.Text,null);
.
. Execute the command
.
ida.SelectCommand=helper.CreateCommand(conn,"select * from B",CommandType.Text,null);
.
. Execute the new command
.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hai guys,
is it possible to serialize a hashtable that contains objects of a class and that particular class contains a hashtable? If it is possible, Please give me your valueble advice
Regards,
Rathish P S
|
|
|
|
|
The HashTable class is itsself serializable. If it only contains object which are either implementing ISerializable or having the Serializable attribute there no reason why you should not be able to serialize it.
Just try marking all classes within the HashTable (and also references other classes) with the Serializable attribute and then serialize it:
<br />
System.Runtime.Serialization.Formatter f = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();<br />
f.Serialize(myStream, myHashTable);<br />
Thats basically all you HAVE to do. There are many problems which can arise, especially when it comes to efficiency. You are free to ask again if you reach such a point
|
|
|
|
|
Ok im so confussed why this happens, but it does...everytime.
In my custom list control, when i add items to the control, the scrollbars adjust.
Now all this works like clockwork until i start adding items to the control from a thread...at which time the items get added just fine to the collection, but after a few milliseconds of adding i see the scrollbar thumb shrink and shrink and then the whole scrollbar literally DIAPPEARS!
I accessed that controls properties with propertygrid when the problem happens and it reports that the control is visible and right where it should be with a viewable size. I really don't know what to do...i think trying to update a scrollbars largechange and maximum from asynch requests to add causes it to bug out...
If theirs no fix for this im gonna have to make my own scrollbar...something that can stand up to the stress.
|
|
|
|
|
Accessing windows controls from threads other than the one which instanciated them has often weird results.
Therefor try to invoke the adding of items, so it gets executed on the thread that instantiated the control. See the docs for the Control.Invoke[^] method for some more infos.
www.troschuetz.de
|
|
|
|
|
Can you show me some example of what the function i pass to my scrollbar's.Invoke looks like. Like parameters and return type... Just never used invoke before and ironically i saw an article on threading on msdn the other day that was just what i needed, but it's not in my browsers history!
|
|
|
|
|
wait nvm, i found what i needed in someone's blog.
Link provided if anyone else needs to know this stuff http://blogs.bartdesmet.net/bart/archive/2004/11/07/462.aspx
|
|
|
|
|
can anyone teach me how to connect to a email server to send emails through my email name??
|
|
|
|
|
|