|
I have a process I am starting up, but it doesn't seem to hid like I would have had it start.
Process someProcess = new Process();
someProcess.StartInfo.FileName = "C:\\someconsoleapp.exe";
someProcess.StartInfo.Arguments = "";
someProcess.StartInfo.CreateNoWindow = true;
For some reason this code didn't work. Is there some way that I can make the console app hidden from within the actual console app itself?
Cheers,
Jim
|
|
|
|
|
I think the following should solve your problem:
someProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden
|
|
|
|
|
Thank you so much! That worked beautifully!
~Jim
|
|
|
|
|
I am trying to filer rows from the database by passing the user input from the textbox to the rowfilter but not working. Here is the code.
DataViewManager myDVM = new DataViewManager(ds);
string filter;
filter = txtSearch.Text ;
myDVM.DataViewSettings["ExpungeName"].RowFilter = "LastName Like 'filter%' ";
However, if I do it directly without the textbox input, it works. Please help.
DataViewManager myDVM = new DataViewManager(ds);
myDVM.DataViewSettings["ExpungeName"].RowFilter = "LastName Like 'Jones%' ";
|
|
|
|
|
Your statement doesnt integrate the string in filter into your RowFilter. Change your statement to:
<br />
myDVM.DataViewSettings["ExpungeName"].RowFilter = "LastName Like '" + filter + "%' ";<br />
|
|
|
|
|
does anybody know how i can delete a .txt file in c#? i'm in urgent and desperate need of an answer.. so i would be very thankful if u can help me... thanks!
vicky
|
|
|
|
|
|
Your probably looking for something like this:
using System.IO;
...
...
FileInfo file = new FileInfo("c:/somefile.txt");
file.Delete();
Hope this helps,
Jim
|
|
|
|
|
tnx to ur replies
vicky
|
|
|
|
|
hi, i need a code that enables me to compress a folder as *.zip format, i need a code so plz.....plz help me by giving me code or dll
Thanks alot
Hamody
|
|
|
|
|
|
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.
|
|
|
|
|