|
moein.serpico wrote: but that field returned no value
How many machines have you tried it on?
If only 1, have you found any application that does return a value for that machine?
It may be that on that particular machine, it is not defined.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
yes
its name is everest
i download it from softpedia
please if you know some way
show me
thanks
|
|
|
|
|
Unfortunately I do not know another way.
It is just that I have one PC where the method suggested by d@nish works, and another where it doesn't.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
|
|
There is nothing that says that a manufacturer of a component MUST supply the information for each field in WMI. There nothing commiting manufacturers to supporting WMI at all, so this is no surprise.
The data comes from the memory itself, probabyl though some port communication, not through WMI. I don't know how to get at it though.
|
|
|
|
|
I am developing an application to play DVD. however When i insert a disk, Windows will automatically try to open that disk either in an explorer window or ask the user what to do with the disk. Then I search in the internet and find two approaches.
The first and simplest is to register the special Windows message "QueryCancelAutoPlay" and simply return 1 when the message is handled. This only works for the current window, and not a background application.
The second approach requires inserting an object that implements the COM interface IQueryCancelAutoPlay COM interface into the Running Object Table.
I used the first one. But sometimes two messages of "QueryCancelAutoPlay" are received and the autoplay window appears again. Here is my code of cancel auto play. Sometimes one message of "QueryCancelAutoPlay" is received and the autoplay window doesn't appear. Sometimes no message of "QueryCancelAutoPlay" is received and the autoplay window appear again.
here is my code of cancel the autoplay window.
IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if (g_uQueryCancelAutoPlay == 0)
{
g_uQueryCancelAutoPlay = RegisterWindowMessage("QueryCancelAutoPlay");
}
if (g_uQueryCancelAutoPlay != 0 && (uint)msg == g_uQueryCancelAutoPlay)
{
System.Windows.MessageBox.Show("QueryCancelAutoPlay1"); //Sometime it appears twice, sometimes it doesn't appear
return (IntPtr)1;
}
return IntPtr.Zero;
}
|
|
|
|
|
|
Thank you. But I want to cancel auto play in my application.
modified on Sunday, September 13, 2009 9:14 PM
|
|
|
|
|
Hi
I'm trying to do a little application to monitor Network traffic and limit the global speed. It's something like NetLimiter.
So, until now, i managed to get all network interfaces and the information for each one(like download and upload speed, bytes send and received,...). I also have information about all network connections and windows processes.
Now, i don't know how to limit the max speed to a given network interface and how to know which process is using which connection.
I know this is not a very good explanation but my english is quite limited.
Thank's
|
|
|
|
|
I need to cast some byte arrays to structs. The solution I have come up with can be seen in the following example.
[StructLayout(LayoutKind.Sequential, Pack = 1)]
internal struct Reading
{
public float value;
public reading_info_struct info;
public override string ToString() {
return value.ToString();
}
#region Byte conversions
public unsafe byte[] ToBytes() {
byte[] arr = new byte[sizeof(Reading)];
fixed (byte* parr = arr) {
*((Reading*)parr) = this;
}
return arr;
}
public static unsafe Reading FromBytes(byte[] arr) {
if (arr.Length < sizeof(Reading))
throw new ArgumentException();
Reading s;
fixed (byte* parr = arr) {
s = *((Reading*)parr);
}
return s;
}
#endregion
}
Is there some less wicked way to do this? I have a lot of these structures and would like to avoid implementing the byte array conversion code in each of them.
In C/C++ this would be easy..
modified on Friday, September 11, 2009 5:55 AM
modified 12-Feb-22 21:01pm.
|
|
|
|
|
Hi,
1.
use PRE tags instead of CODE tags, they preserve formatting.
2.
have a look at the Marshal class, e.g. its PtrToStructure() method.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
That looks OK to me; the class should handle itself.
|
|
|
|
|
I'm currently using VS2005 Crystal report... I cant pass the parameter from Main report to its sub report.... it always encounter an error "@pParameter" value expected
I can successfully display a crystal report with parameters but it will fail when it involves subreports.... I don't understand also why I cant display the above parameter but i noticed it runs successfully because it will display the expected output...
hope to here some1 who can share thier ideas..
Thank you
below is the code:
string reportName = Session["ReportName"].ToString();
string reportDate = Session["ReportDate"].ToString();
string reportType = Session["ReportType"].ToString();
rpt.Load(Server.MapPath("~/Reports/" + reportName.ToString()));
crConnectionInfo.ServerName = Session["MyServer"].ToString();
crConnectionInfo.DatabaseName = Session["myDatabase"].ToString();
crConnectionInfo.UserID = "myUser";
crConnectionInfo.Password = "myPassword";
crDatabase = rpt.Database;
crTables = crDatabase.Tables;
CrystalReportViewer1.ReportSource = rpt;
ParameterDiscreteValue discreteBranch = new ParameterDiscreteValue();
ParameterFields paramFields = new ParameterFields();
ParameterDiscreteValue paramDiscreteBranch = new ParameterDiscreteValue();
ParameterField paramFieldBranch = new ParameterField();
paramFieldBranch.Name = "@pBranchCode";
paramDiscreteBranch.Value = Session["branchCode"].ToString();
paramFieldBranch.CurrentValues.Add(paramDiscreteBranch);
paramFields.Add(paramFieldBranch);
ParameterDiscreteValue paramDiscreteTranDate = new ParameterDiscreteValue();
ParameterField paramFieldTranDate = new ParameterField();
paramFieldTranDate.Name = "@pTransactionDate";
paramDiscreteTranDate.Value = reportDate;
paramFieldTranDate.CurrentValues.Add(paramDiscreteTranDate);
paramFields.Add(paramFieldTranDate);
CrystalReportViewer1.ParameterFieldInfo = paramFields;
discreteBranch.Value = Session["branchName"].ToString();
rpt.SetParameterValue("BranchName", discreteBranch);
discreteBranch.Value = Session["branchaddress"].ToString();
rpt.SetParameterValue("BranchAddress", discreteBranch);
xxx
|
|
|
|
|
hey body to get an answer first put ur code in a codeblock ......... so that other can see it well and give u a reply
|
|
|
|
|
I don't know f u read my post very well or u just don't understand.... i already put the entire code block in my post....
xxx
|
|
|
|
|
I am using Iexpress.exe to package all installation files(setup.exe,msi,.net framework etc) into single exe.
But the exe is not working.
I have created a batch file including following:
@ECHO OFF
CLS
MD dotnetfx
MOVE /-Y dotnetfx.exe dotnetfx
MOVE /-Y instmsia.ext dotnetfx
MOVE /-Y WindowsInstaller-KB893803-v2-x86.exe dotnetfx
EXIT
And selecting batch file,setup.exe and msi file in iexpress.exe for creating package.
Got the single exe but while installation i am getting:
This installation package could not be opened. Verify that the package exists and that you can access it or contact the application vendor to verify that this is a vlaid windows installer package.
And InstallLog file shows:
The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [ProcessorArchitecture] = Intel {string}
Property: [VersionNT] = 6.0.1 {version}
Running checks for package '.NET Framework 2.0 (x86)', phase BuildList
Running external check with command 'C:\Users\user\AppData\Local\Temp\VSD12B7.tmp\DotNetFX\dotnetchk.exe' and parameters ''
Process exited with code 1
Setting value '1 {int}' for property 'DotNetInstalled'
Reading value 'Version' of registry key 'HKLM\Software\Microsoft\Internet Explorer'
Read string value '7.0.6001.18000'
Setting value '7.0.6001.18000 {string}' for property 'IEVersion'
The following properties have been set for package '.NET Framework 2.0 (x86)':
Property: [DotNetInstalled] = 1 {int}
Property: [IEVersion] = 7.0.6001.18000 {string}
Running checks for command 'DotNetFX\instmsia.exe'
Result of running operator 'ValueExists' on property 'VersionNT': true
Result of checks for command 'DotNetFX\instmsia.exe' is 'Bypass'
Running checks for command 'DotNetFX\WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'ValueExists' on property 'Version9x': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.0.3': false
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.0': true
Result of checks for command 'DotNetFX\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
Running checks for command 'DotNetFX\dotnetfx.exe'
Result of running operator 'ValueNotEqualTo' on property 'DotNetInstalled' and value '0': true
Result of checks for command 'DotNetFX\dotnetfx.exe' is 'Bypass'
'.NET Framework 2.0 (x86)' RunCheck result: No Install Needed
Running checks for package 'Windows Installer 3.1', phase BuildList
The following properties have been set for package 'Windows Installer 3.1':
Running checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
Result of checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
'Windows Installer 3.1' RunCheck result: No Install Needed
Launching Application.
Running command 'C:\Windows\system32\msiexec.exe' with arguments ' -I "C:\Users\user\AppData\Local\Temp\IXP000.TMP\tes.msi" '
Please give me clue where I am going wrong.
Thanks in Advance
Gtag.
|
|
|
|
|
I would investigate a thing called "Inno Setup" it is extremely good !
|
|
|
|
|
I'm currently doing SMS system with C#.
I have no idea how to retrieve a website(timetable) that requires an input. Anyone can help?
This is my code:
public string generateURL(string id)
{
string siteUri ="http://utptt-ex.petronas.com.my/studentInd.htm";
webrequest wr= webrequest.create(siteUri);
return wr;
}
But i have some bugs. Is there anyone who has better codes to this?
|
|
|
|
|
I think you might be trying this using HTTP over TCP/IP.. If so then you need to hit an uri with some parama..and retrieve the acknowledgment.
Try this link
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
Thanks
Md. Marufuzzaman
|
|
|
|
|
Follow the Following code. Pass the number to Download function in string format. You ll get the answer. Worked for me.
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
namespace RequestURL
{
class Program
{
static void Main(string[] args)
{
string response = Download("0");
Console.WriteLine(response);
Console.ReadLine();
}
private static string Download(string number)
{
string text = "http://utptt-ex.petronas.com.my/Reporting/Individual?identifier=" + number + "&B1=View+Timetable&objectclass=students&idtype=id&width=100&periods=1-30";
string responseFromServer = "";
try
{
WebRequest request = WebRequest.Create(text);
request.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
responseFromServer = reader.ReadToEnd();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
return responseFromServer;
}
}
}
|
|
|
|
|
Thank you for the codes, can I save the response from the web into a file?
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
namespace RequestURL
{
class Program
{
static void Main(string[] args)
{
string response = Download("0");
Console.WriteLine(response);
Console.ReadLine();
}
private static string Download(string number)
{
string text = "http://utptt-ex.petronas.com.my/Reporting/Individual?identifier=" + number + "&B1=View+Timetable&objectclass=students&idtype=id&width=100&periods=1-30";
string responseFromServer = "";
try
{
WebRequest request = WebRequest.Create(text);
request.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream, Encoding.ASCII);
responseFromServer = reader.ReadToEnd();
StreamWriter writer = new StreamWriter("C:\\a.txt");
writer.Write(responseFromServer);
writer.Close();
reader.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
return responseFromServer;
}
}
}
|
|
|
|
|
my english is pool. i don't know clearly.
for example:
public static string Post(string action, string parmString)
{
try
{
//Encode
Encoding myEncoding = Encoding.GetEncoding("GB2312");
//get URL
Uri myUri = new Uri(action);
//byte[]
byte[] paramBytes = myEncoding.GetBytes(parmString);
//new a webrequest
WebRequest myWebRequest = WebRequest .Create(myUri);
//set ContentType
myWebRequest.ContentType = "application/x-www-form-urlencoded";
//set Method
myWebRequest.Method = EnumWebMethod.POST.ToString();
//init request, get back stream
using (Stream requestStream = myWebRequest.GetRequestStream())
{
//send data
requestStream.Write(paramBytes, 0, paramBytes.Length);
}
//send request, get WebResponse object
WebResponse myWebResponse = myWebRequest.GetResponse();
//
using (StreamReader myStreamReader = new StreamReader(myWebResponse.GetResponseStream(), myEncoding))
{
return myStreamReader.ReadToEnd();
}
}
catch
{
return "request error!";
}
}
i hope i can help you.
modified on Wednesday, September 23, 2009 9:41 PM
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 22:04pm.
|
|
|
|
|
HI
I am developing a .NET MyLib.dll to be exposed via COM to Excel.
In It there is a class called MyDotNetClass ( ComVisible is set to ture
and I have GUID attributer )
When I pass a Range to my AnyMethod and I want to get the FormulaR1C1Local
everything is thine.
When I want to call other method other than this ( including the getValue to get
the real valu conatined by the cells in that range, not its formula )
I have a lot of exception most of the same time.
Can you help me with that?
I already have a reference to Microsoft.Office.Interop.Excel library V12.0
for Excel 2007.
Thanks
Mn
<br />
class MyDotNetClass<br />
{<br />
String AnyMethod( Microsoft.Office.Interop.Excel.Range aRange )<br />
{<br />
object[,] formula = (object[,])aRange.FormulaR1C1;<br />
<br />
<br />
<br />
}<br />
}<br />
<br />
'VB CODE<br />
Function MyFoo( aRange As Range) As String<br />
Dim myLibObj As New MyLib<br />
MyFoo = myLibObj.AnyMethod( aRange )<br />
End Function<br />
|
|
|
|