|
PSEXEC[^]. But, the down side is that most virus scanning software considers this app to be an "unwanted" .exe. If the virus scanner sees it and doesn't like it, the scanner will stop PSEXEC from running.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello All ,
I am Again taking your Time for same problem but in reverse format
Plz help me
Is There any way to Convert the Date in one Format to Another Format
I am taking Date in System Format(i.e MM/dd/yyyy hr:mi:se AM) from database
Now I need to take this date from database as a string and Convert to dateTime of format dd/MM/yyyy and display in back to Textbox
InShort :- Displaying date in dd/MM/yyyy taking from database in MM/dd/yyyy format
Thanks for any help anyone is able to give me.
|
|
|
|
|
The code would be something like:
DateTime dt;
DateTime.TryParse(YourSTringHere,dt);
textbox.Text = dt.ToString("dd/MM/yyyy");
Hope that helps.
Ben
|
|
|
|
|
the DateTime class has a Parse() method and a ToString() method to convert from and to
a string; both accept an IFormatProvider to specify the format, so you can do all
kinds of conversions, whatever you want.
You must make sure the format used to store/persist the datetime is fixed (hence you
really should always specify a constant IFormatProvider), so it
works independent of your System's regional settings; if you fail to do so, your database
or file will not work on some other machines.
You have had all of this on your earlier questions. I dont understand why you ask again.
|
|
|
|
|
Good Day Sir/Maam,
I'm here to inquire about the name of the IO Exception thrown when I tried to write to a certain location (EX: Drive A and the Drive is already full.
Tried searching on google, but came up with nothing valuable.
Thank you in Advance, Good Day.
|
|
|
|
|
If you are using .net 2.0 there is a DriveInfo class that you can use.
Here is a MSDN link:
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref8/html/T_System_IO_DriveInfo.htm
Ben
|
|
|
|
|
Sir, Im using File.Copy to copy a file, is there an exemption thrown if the "location" im writing is at full capacity?
|
|
|
|
|
Most likely you would get an IOException. I don't know for sure since I haven't tried it. I think it would probably be a better idea to use the driveinfo class to check you drive and figure out how much space is left before you try to copy the file.
Ben
|
|
|
|
|
Anyone knows, how to use a MS Access DB file in pocket pc 2003 SE within C# smart device project?
thanks a lot.
email me: myope@mail2000.ru
|
|
|
|
|
RSACryptoProvider creation problem:
I used some code for RSACryptoProvider creation with smart card and CAPICOM COM object
The code worked well in Framework 1.1
but when I tried the same code in Framework 2.0
I got an following Cryptographic exception:
"Unable to open the access token of the current thread"
string url = string.Empty;<br />
rsa = null;<br />
certificate = null;<br />
RSACryptoServiceProvider.UseMachineKeyStore = true;<br />
<br />
CspParameters csp = new CspParameters();<br />
csp.Flags = CspProviderFlags.UseMachineKeyStore;<br />
ICertificate2 selectedCert = null;<br />
<br />
<br />
Store st = new Store();<br />
<br />
st.Open(CAPICOM_STORE_LOCATION.CAPICOM_CURRENT_USER_STORE, "My", <br />
<br />
CAPICOM_STORE_OPEN_MODE.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED);<br />
foreach (ICertificate2 currCert in st.Certificates)<br />
{<br />
<br />
if (currCert.HasPrivateKey())<br />
{<br />
selectedCert = currCert;<br />
break;<br />
}<br />
}<br />
if (selectedCert == null || selectedCert.HasPrivateKey() == false || <br />
<br />
selectedCert.PublicKey().Algorithm.FriendlyName != "RSA")<br />
{<br />
StringBuilder sb = new StringBuilder();<br />
sb.Append("Can't find a vaild certificate!\n\n");<br />
sb.Append("Valid Certificate Authorities are :\n");<br />
System.Collections.IEnumerator myEnum = issuerlist.GetEnumerator();<br />
while (myEnum.MoveNext()) sb.Append(myEnum.Current).Append("\n");<br />
throw new Exception(sb.ToString());<br />
}<br />
<br />
certificate = selectedCert;<br />
<br />
csp.KeyContainerName = selectedCert.PrivateKey.ContainerName;<br />
csp.ProviderName = selectedCert.PrivateKey.ProviderName;<br />
csp.ProviderType = Convert.ToInt32(selectedCert.PrivateKey.ProviderType);<br />
<br />
switch (selectedCert.PrivateKey.KeySpec)<br />
{<br />
case CAPICOM_KEY_SPEC.CAPICOM_KEY_SPEC_KEYEXCHANGE:<br />
csp.KeyNumber = 1;<br />
break;<br />
<br />
case CAPICOM_KEY_SPEC.CAPICOM_KEY_SPEC_SIGNATURE:<br />
csp.KeyNumber = 2;<br />
break;<br />
}:omg:<br />
if (selectedCert.PrivateKey.IsMachineKeyset())<br />
{<br />
csp.Flags = CspProviderFlags.UseMachineKeyStore;<br />
}<br />
try<br />
{<br />
rsa = new RSACryptoServiceProvider(csp);
}<br />
catch<br />
{ }
|
|
|
|
|
I am trying to run application on remote pc by doing some thing like this:
ConnectionOptions objConnectionOptions = new ConnectionOptions();
objConnectionOptions.Impersonation = ImpersonationLevel.Impersonate;
objConnectionOptions.EnablePrivileges = true;
objConnectionOptions.Username = strUserName;
objConnectionOptions.Password = strPassword;
ManagementScope objManagementScope = new ManagementScope(@"\\remote-machine-name\ROOT\CIMV2", objConnectionOptions);
objManagementScope.Connect();
ManagementClass processClassFinal = new ManagementClass(objManagementScope, new ManagementPath("Win32_Process"), null);
ManagementBaseObject inParamsFinal = processClassFinal.GetMethodParameters("Create");
inParamsFinal["CommandLine"] = @"\\remote-machine-name\some-directory\someProgram.exe";
ManagementBaseObject outParamsFinal = processClassFinal.InvokeMethod("Create", inParamsFinal, null);
But for some reason it does not work and I don't know why???????
outParamsFinal["processId"] returns null, instead of a valid processId.
Is there any one who could help me in that..............
Thanks
Sarfraz
|
|
|
|
|
after i made my website and aspx pages
and i upload the website
i recive this error
Server Error in '/' Application.
-----------------------------------------------------------------------------
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customerrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customerrors> tag should then have its "mode" attribute set to "Off".
<configuration>
<system.web>
<customerrors mode="Off">
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customerrors> configuration tag to point to a custom error page URL.
<configuration>
<system.web>
<customerrors mode="RemoteOnly" defaultredirect="mycustompage.htm">
----------------------------------------------------------------------------
so can any one solve this problem
or tell me how to solve it
thanks all
bye
Ahmed EL Gendy
|
|
|
|
|
Change the web.config as suggested, or if you're able, get onto the box (ie using terminal services or similar) then when you run the application it'll give you the stack trace which should help you locate the error.
.NET hides the full details by default unless you're running it on the box where the web application is hosted.
|
|
|
|
|
Hi,
On internet, i see everyone said : "If you are not sure which port is available, you can use 0 and server will search automatically for available port", but i doubt how could client call method on server when client don't know server's port?
Example :
On Server
ChannelServices.RegisterChannel(new TcpServerChannel(0));
On Client
MyClass obj = (MyClass)Activator.GetObject(typeof(MyClass),"tcp://localhost:?/Hello");
What number could i put in "?" ?
|
|
|
|
|
i want to create button
when click that button it's return 1 ,0
the returned number in random way
ma_refay
|
|
|
|
|
Random class[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Buttons don't have return values.
(new Random()).NextDouble(); will give you a random number between 0 and 1, inclusive.
File Not Found
|
|
|
|
|
i want the answer of that work tody to finish my tasks iam lating
i want to make an array that contain of 25 numbers this array contain only 0,1 and the aray is create random so the arrang of number is chane automaticaly evry time i create it
ma_refay
|
|
|
|
|
Random r = new Random();
int[] arr = new int[25];
for(int i = 0; i < 25; ++i)
arr[i] = r.Next() % 2;
|
|
|
|
|
Random class[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi,
What i need to do is to get the path on the local filesystem were a notepad application is saved. I have written a C# console application which spawns a notepad process. When the user clicks on the notepad File -> Save menu I need to capture the location where the it is saved.
I used System.Diagnostics.Process to start the notepad process. it seems I have to use P/ Invoke to get the work done. But can't figure out how. Please help me.
Thanks.
Harsha Kamat
|
|
|
|
|
Try Environment.GetFolderPath(Environment.SpecialFolder.System) to get the system path, then
Path.Combine(..., "notepad.exe")<br />
<br /> Or alternatively Process.Start("notepad.exe") (which uses the shell).
|
|
|
|
|
The 'Environment.GetFolderPath(Environment.SpecialFolder.System)' will give the path to the notepad.exe application. What i want is the local filesystem path where the contents of a new Notepad will be saved. i.e the path the user selects in the FILE->SAVE menu of the Notepad application.
Harsha kamat
|
|
|
|
|
Don't think that's possible without some really clever low-level API hooking wizardry and several large pinches of salt.
|
|
|
|
|
How to access variable in one Form from anothre form, and how to send data or messeges
between them.
I have two forms (Forms1 and Fomr2) and what i want is: when i click on a specific button in Form1 i want a specefic message (migth be written in textbox in Form1) to be sent to Form2 and then displayed
in listbox there.
|
|
|
|