|
Interesting - I'm getting a 'Type xxx is not defined' error. Made sure there's no typos. I'll check it out more later.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
How we can dézip file?? i have search bu i have not find the free class to dezipe, pleaz help me to resolve this problem thank you verry mutch.
|
|
|
|
|
try SharpZipLib[^]
hope it helps
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
Hello,
I try for :
<br />
<br />
FileStream fileStreamIn = new FileStream(@"G:\5.zip", FileMode.Open, FileAccess.Read);<br />
ZipInputStream zipInStream = new ZipInputStream(fileStreamIn);<br />
ZipEntry entry = zipInStream.GetNextEntry();<br />
FileStream fileStreamOut = new FileStream(@"c:\unzip_file", FileMode.Create, FileAccess.Write);<br />
<br />
int size;<br />
byte[] buffer = new byte[BufferSize];<br />
do<br />
{<br />
size = zipInStream.Read(buffer, 0, buffer.Length);<br />
fileStreamOut.Write(buffer, 0, size);<br />
} while (size > 0);<br />
<br />
zipInStream.Close();<br />
fileStreamOut.Close();<br />
<br />
unfortunatly in C:\\ i find unzip_file with empty, i d(ont obtain folder!! help me please, thank you verry mutch.
|
|
|
|
|
System.IO.Compression.GZipStream or System.IO.Compression.DeflateStream.
First one includes zip headers, the other one handles raw data. GZipStream from what I've heard handles only simpler files, so if it won't be enough for your need, try external library that Mbah Dhaim has mentioned.
|
|
|
|
|
Hello,
Can we Show a console window for 10sec in C# console application??
Thank you verry mutch.
|
|
|
|
|
is this what you mean?
System.Console.WriteLine("Show in 10s");
System.Threading.Thread.Sleep(10000);
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
but on end of 10 the console window is showed, i would close it, thank you veery mutch.
|
|
|
|
|
try this
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace ConsoleApplication1
{
class Program
{
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
static void Main(String[] args)
{
System.Console.Title = "myconsole";
IntPtr hWnd = FindWindow(null, "myconsole");
ShowWindow(hWnd, 0);
System.Threading.Thread.Sleep(10000);
ShowWindow(hWnd, 1);
System.Console.ReadLine();
}
}
}
but at first time your console will appear
any idea?
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
You want to show windows for 10 secs and then close it, but still have running app? You could try doing it by building application as WindowApp, allocating and freeing console using PInvoke (search for AllocConsole).
I was bored, so I've cooked up sth like this:
public class Program
{
[DllImport("kernel32.dll")]
static extern int AllocConsole();
[DllImport("kernel32.dll")]
static extern int FreeConsole();
[DllImport("kernel32.dll")]
static extern IntPtr GetStdHandle(int nStdHandle);
public static void Main()
{
AllocConsole();
IntPtr outp = GetStdHandle(-11);
SafeFileHandle safeOut = new SafeFileHandle(outp, true);
Stream str = new FileStream(safeOut, FileAccess.Write);
TextWriter con = new StreamWriter(str);
con.Write("ff");
con.Flush();
Thread.Sleep(10000);
safeOut.Close();
FreeConsole();
Thread.Sleep(10000);
}
As you can see, obtaining TextWriter is a bit more tricky, but after doing that, it's as simple as using Console.Write.
|
|
|
|
|
Hello,
How i can verify if an excetubale like word.exe or excel.exe work in my machine? Thank you verry mutch.
|
|
|
|
|
Hello,
I'm stuck on a problem casting an LPARAM.
I'm attempting to broadcast a message to all window handles using:
SendMessageTimeout(
HWND_BROADCAST,
WM_SETTINGCHANGE,
SPI_SETNONCLIENTMETRICS,
(LPARAM)"WindowMetrics",
SMTO_NORMAL|SMTO_ABORTIFHUNG,
10000, NULL);
But the cast (LPARAM) does not seem to work. {I think that's call a cast)
Can anyone help me write the (LPARAM)"WindowMetrics" attribute properly?
Thanks,
Matt Brown
|
|
|
|
|
Hey Matt, you posted this in the C# forum but there is no indication in your post that you are using C# so can you verify you are using C#?
bbranded wrote: But the cast (LPARAM) does not seem to work.
On what are you basing that statement?
bbranded wrote: Can anyone help me write the (LPARAM)"WindowMetrics" attribute properly?
Those are called function "parameters" not "attributes".
|
|
|
|
|
1) Since I posted in the c# forum, assume I'm using C#
2) I'm not sure I'm using the right terminology by using the word "cast." I tried it, it's not working.
3) Great.
I'm trying to refresh the desktop icon cache and found this page[^] (see "Flushing Cache Entries").
This is[^] what I'm working on doing at this moment. I have hopes it will work.
[FYI: this[^] works fine]
private static extern long SendMessageTimeout(
int hWnd,
int Msg,
int wParam,
string lParam,
int fuFlags,
int uTimeout,
out int lpdwResult
);
RegistryKey k = Registry.CurrentUser.OpenSubKey("Control Panel").OpenSubKey("Desktop").OpenSubKey("WindowMetrics", true);
k.SetValue("Shell Icon Size", "33");
k.Flush(); k.Close();
int res = 0;
SendMessageTimeout(0xffff, 0x001A, 0, "", 0x0002, 5000, out res);
k = Registry.CurrentUser.OpenSubKey("Control Panel").OpenSubKey("Desktop").OpenSubKey("WindowMetrics", true);
k.SetValue("Shell Icon Size", "32");
k.Flush(); k.Close();
SendMessageTimeout(0xffff, 0x001A, 0, "", 0x0002, 5000, out res);
I believe the common misconception with this strategy of icon cache clearing is that all of the icons move to the left side, to their "default" position (as if you click on the "align icons by name" verb in the progman context menu, etc). However, it is notable that this is only the case when (like TweakUI) you originally resize the icons to a very low number (let's say 4), causing their "foot print" to be very small (but in the same "positions" as you were before (like zooming out on a picture), before calling WM_SETTINGCHANGE. Therefore, when you resize them again (let's say to 32), then call WM_SETTINGCHANGE; all of your icons will assume this size and "force each other out of the way," and they will now appear to be aligned on the left side of the screen.
That's why it's suggested in both the Microsoft KB, and in various other sources, to resize the icon size value one lesser than or one greater than you current size.
Hope that's clear.
modified on Friday, March 20, 2009 6:33 PM
|
|
|
|
|
You'd be surprised and appalled at how often people new to the forums post here instead of the c++ forum, and what you were doing could just as easily be c++. Like it or not, sanity checks are inevitable.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Nice reply. As Dan points out, it is rare and a pleasure when someone posts as clear and complete as you have been.
What I believe you are struggling with is managed versus native memory issues. Some managed types match native types but strings are not one of them ( because they are pointers to memory) and require marshaling.
Check out this article[^] it should get you started down the path to your solution.
|
|
|
|
|
I've not used these stuff before except processing messages. However, I think you should convert the string to char[] and set it fixed then pass a pointer in the LParam.
Eslam Afifi
|
|
|
|
|
Hi All,
I am in a new situation for me i have to integrate a Microsoft Project into an asp.net application using C# i havent used Microsoft project until now so am really confused on how do get this task done.
I have to develop an interface where i can download a project into my asp.net application and vice versa.
I have searched a lot for help and all i get is automation of evrything except MS Project so if anyone of you can help me out of this situation its going to be a great help.
Hoping to see some replies asap.
Thanks in Advance,
Krishna.
|
|
|
|
|
kcadella wrote: I have searched a lot for help and all i get is automation of evrything except MS Project so if anyone of you can help me out
click here[^]
|
|
|
|
|
Thanks Mike , right now am working on something else i ll checkout the link and will mail you if i need any further help.
Thanks,
Krishna.
|
|
|
|
|
Hey Mike can you please provide me with some clear info on the integration of Project with visual studio.net am very very new to MS project so i wud appreciate if you help me out on this one.
Thanks,
Krishna.
|
|
|
|
|
Hello,
For my senior project, I need to make voice records from the microphone by using C#. I have made a research, but could not find a solution. What I want the program to accomplish is:
- It must periodicially record the sounds to any folder. For example, if the period is 5 seconds, the audio files can be such this:
* C:\MySounds\20090320172902.vaw -- (5 seconds)
* C:\MySounds\20090320172907.vaw -- (5 seconds)
* C:\MySounds\20090320172912.vaw -- (5 seconds)
(Naming the files is easy, it is not a problem).
- I have found a good example in this site:
http://www.codeproject.com/KB/audio-video/Mp3SoundCapture.aspx[^]
I wanted to use this program, but as I know, despite they are free source codes these kind of programs require a licence when we want to use in senior projects. Namely, we cannot use them in any project that can be sold in the future.
- I have made a research about sndrec32.exe . Some people had tried this like the following:
string strFilePath = @"C:\" + "file1001" + ".wav";
FileStream waveFile = File.Create(strFilePath);
waveFile.Close();
Process.Start("sndrec32", strFilePath);
But it didn't work. sndrec32.exe needs somebody to push its "RECORD" button and after five seconds, to push its "STOP" button, and then click "SAVE".
Is there any solution for my problem? Will I be able to record sounds from my microphone in periods of 5 seconds without paying for licence; namely with my "own" program?
Thanks...
|
|
|
|
|
Emre Gürbüz wrote: despite they are free source codes these kind of programs require a licence
I am assuming you meant "license".
Emre Gürbüz wrote: Namely, we cannot use them in any project that can be sold in the future.
Really? You believe that is what the following excerpt from the CPOL means?
The main points subject to the terms of the License are:
* Source Code and Executable Files can be used in commercial applications;
* Source Code and Executable Files can be redistributed; and
* Source Code can be modified to create derivative works.
and 3.D
You may distribute the standard version of the Executable Files and Source Code or
Derivative Work in aggregate with other (possibly commercial) programs as part of a larger
(possibly commercial) software distribution.
If you think that "can be used in commercial applications" means you "cannot use them in any project that can be sold in the future", then you might want to seek some assistance in interpreting the CPOL.
|
|
|
|
|
The following comments are copied from the source code of the project that I have given a link for:
// About Thomson and/or Fraunhofer patents:
// Any use of this product does not convey a license under the relevant
// intellectual property of Thomson and/or Fraunhofer Gesellschaft nor imply
// any right to use this product in any finished end user or ready-to-use final
// product. An independent license for such use is required.
// For details, please visit http://www.mp3licensing.com.
As I have understood, when you intend to use it in commercial applications, you need to have an independent license.
By the way, I am from Turkey, I may have faulty statements in my sentences, but trying to do my best
|
|
|
|
|
In this case you're right. If the CP article is using material patented by Thomson/Fraunhofer, CPOL only covers the CP article code; not the T/F material. AFAIK the T/F patents only cover the .mp3 format, so if you use the article code to save in a different format none of their restrictions should apply, leaving only the CPOL.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|