Click here to Skip to main content

Comments by sunder.tinwar (Top 74 by date)

sunder.tinwar at 15-Feb-13 5:36am View
   
here everything, the dll, the application is builded in x64. Untill I don't create object of class in the library, if I build it works fine. But as soon as I start using dll its throw this error.
sunder.tinwar at 10-Sep-12 1:08am View
   
thanks using this i have solved my all issues. Now I have only one question for you. Compiling NSIS scripts gives me a .exe file, can it also return .MSI file
sunder.tinwar at 5-Sep-12 7:17am View
   
can you guys redirect me to some tutorial where I can create custom dialog and code against those. I started reading NSIS tutorials. Look like somehow I can meet my requirement using this. Please help thanks.
sunder.tinwar at 14-Aug-12 0:50am View
   
thanks for reply. So as per you, there is no 3rd party framework exits which can solve this issue. So I need implement my own solution.
 
Can you walk me through with the solution process. I have lots of queries in that?
sunder.tinwar at 31-Jul-12 4:52am View
   
anyone knows simple .net approach to solve this.
sunder.tinwar at 30-Jul-12 5:40am View
   
yes i wanted to create something like psexec only. is there any other work around also?
sunder.tinwar at 30-Jul-12 4:47am View
   
thats gone make my code very critical. I need to handle event for each command if i end up using multithreading.
I am looking for simple C# solution if possible. If not then I will think over WMI.
sunder.tinwar at 30-Jul-12 4:30am View
   
thanks for reply. now read this : http://stackoverflow.com/questions/1405209/how-to-execute-a-command-in-a-remote-machine-and-get-the-output-using-c-net
 
here with WMI approach we can't identify when the process is finished execution.
sunder.tinwar at 3-Jul-12 6:45am View
   
Its will become complicated for me in that case as mine MSI is not normal windows msi setup, It run my custom installer and accept input from user.
sunder.tinwar at 3-Jul-12 5:42am View
   
so except HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall this location when we install product MSI dont write information anywhere else? I though it might be maintaining a local db? anyhow, that was important information I browsed registry and verified that.
sunder.tinwar at 3-Jul-12 5:39am View
   
thanks for information, ClickOnce dont work well with windows service. Its good for windows or wpf applications.
sunder.tinwar at 3-Jul-12 5:01am View
   
how the files on server should be? In zip or what? and what if any error while extraction?
sunder.tinwar at 3-Jul-12 4:28am View
   
thanks for reply, I know that if I stop service replace exe and dlls and start service app will work great. But only doubt I had is I installed version 1.0.0.0 from MSI installer and updated exe and dlls to version 1.0.0.1. When I try to uninstall it from program and feature will it work? Still have that doubt
sunder.tinwar at 21-Mar-12 12:40pm View
   
This is just about active directory. But what information do active directory hold and on what OS it will be supported.
 
How to know user passwords verifications etc...security related stuff. How i can query that.
sunder.tinwar at 21-Mar-12 11:23am View
   
Yes I know the question is little vague. But I basically want to know how information is catagorized in windows which a developer can query using c#.
 
I am working on a project where I have to query different information using WMI and Active directory and even user profile and security based query which I am not aware how to do.
 
Apart from this I dont have initial knowledge about Active Directory and how user profile is maintained in windows.
sunder.tinwar at 25-Feb-12 14:15pm View
   
@Naerling what you are saying is also right, each business object can't implement interface and repeate same functionality.
 
Can you guys give generic example here.
 
My requirement is not specifically to any project. I just wanted to what are best possible way to do such kind of work. Like all companies follow extensive OOPS or just work to acheive goal. You can give me example of any other problem apart from this.
 
Thanks.
sunder.tinwar at 25-Feb-12 9:56am View
   
thanks for reply, make perfect sense. Can you give any example regarding that.
sunder.tinwar at 25-Feb-12 9:52am View
   
thanks for reply. I just wanted to know how anyone here would design a class which will meet above requirement and will be easily scalable in future.
sunder.tinwar at 25-Feb-12 9:05am View
   
thanks for reply....it was my first code.....
 
how is this, as i corrected it with a friends comments on my design
 
public abstract class Product
{
protected string _productName = string.Empty;
protected double _productPrice;
 
public string ProductName { get { return _productName; } }
public double ProductPrice { get { return _productPrice; } }
}
 
public class ExemptedProduct : Product
{
public ExemptedProduct(string productName, double price)
{
this._productName = productName;
this._productPrice = price;
}
public double ComputeSalesTax()
{
return _productPrice * .05;
}
}
 
public class TaxPaidProduct : Product
{
public TaxPaidProduct(string productName, double price)
{
this._productName = productName;
this._productPrice = price;
}
public double ComputeSalesTax()
{
return _productPrice * .15;
}
}
 
public class ShoppingCart
{
List _productList = new List();
 
class ShoppingCartDataSource
{
private Product _product;
private int _quantity;
private bool _isImportedProduct;
 
public Product CartProduct { get { return _product; } }
public int Quantity { get { return _quantity; } }
public bool IsImportedProduct { get { return _isImportedProduct; } }
 
public ShoppingCartDataSource(Product product, int quantity, bool isImportedProduct)
{
_product = product;
_quantity = quantity;
_isImportedProduct = isImportedProduct;
}
}
 
public void AddProduct(Product product, int quantity, bool isImportedProduct)
{
_productList.Add(new ShoppingCartDataSource(product,quantity,isImportedProduct));
}
 
public void GenerateCartBill()
{
double totalTax = 0;
double netTotal = 0;
foreach (var product in _productList)
{
double tax=computeSalesTax(product);
Console.WriteLine(product.CartProduct.ProductName + " | " + (product.CartProduct.ProductPrice + tax) + " | " + product.Quantity);
totalTax += tax;
netTotal += product.CartProduct.ProductPrice + tax;
}
Console.WriteLine("Total Tax : " + totalTax);
Console.WriteLine("Total : " + netTotal);
}
 
private double computeSalesTax(ShoppingCartDataSource cartItem)
{
double tax = 0;
if (cartItem.CartProduct is ExemptedProduct)
{
if (cartItem.IsImportedProduct)
tax = (cartItem.Quantity * cartItem.CartProduct.ProductPrice) * .05;
}
else if (cartItem.CartProduct is TaxPaidProduct)
{
if (cartItem.IsImportedProduct)
tax = (cartItem.Quantity * cartItem.CartProduct.ProductPrice) * .15;
else
tax = (cartItem.Quantity * cartItem.CartProduct.ProductPrice) * .10;
}
return Math.Round(tax,2);
}
}
 
public class Program
{
public static void Main()
{
ShoppingCart cart = new ShoppingCart();
cart.AddProduct(new TaxPaidProduct("Imported Perfume", 27.99), 1, true);
cart.AddProduct(new TaxPaidProduct("Perfume", 18.99), 1, false);
cart.AddProduct(new ExemptedProduct("Headache Pills", 9.75), 1, false);
cart.AddProduct(new ExemptedProduct("Imported Chocolate", 11.25), 1, true);
 
cart.GenerateCartBill();
}
}
 
Please guide how can i improve my OOAD skills....thanks.
sunder.tinwar at 19-Feb-12 12:28pm View
   
Hi Bill,
 
thanks for reply, this what they(their own words) said in mail when they asked this question -
 
For the solution, we would want you use either Java, Ruby or C#.
 
·We are interested in the DESIGN ASPECT of your solution and would like to evaluate your
 
OBJECT ORIENTED PROGRAMMING SKILLS.
 
·You may use external libraries or tools for building or testing purposes. Specifically, you may use
 
unit testing libraries or build tools available for your chosen language (e.g., JUnit, Ant, NUnit, NAnt,
 
Test::Unit, Rake etc.)
 
·Optionally, you may also include a brief explanation of your design and assumptions along with
 
your code.
 
·Kindly note that we are NOT expecting a web-based application or a comprehensive UI. Rather,
 
we are expecting a simple, console based application and interested in your source code.
sunder.tinwar at 24-Dec-11 2:20am View
   
I am planing to use microsoft sync framework.
sunder.tinwar at 22-Dec-11 23:32pm View
   
Actually, I have to do both. syncing one or more clients against server and reflecting same on other clients also for report generation. And client can have even provision to download master tables directly from service when first time installed.
sunder.tinwar at 9-Nov-11 0:29am View
   
but i can use same ISO to installed on my friend laptop there it works nicely?
sunder.tinwar at 9-Nov-11 0:12am View
   
I have manually installed Visual Studio 2010 64 bit Prerequisites (x64) and installed successfully.
 
Then I have manully updated my .NET framework also by reparing it.
 
My Windows Installer service mode is manual in services.msc.
 
I have cleared my temp files and prefetch files and tried thrice now.
sunder.tinwar at 22-Sep-11 1:09am View
   
thats what i dont want to do? I dont want to change UI? what ever i have to do is from coding. Parse string and convert into a correct format? Any ideas regarding that?
sunder.tinwar at 28-Jun-11 0:23am View
   
I only suggested this link in my last post. But there is not information provided about keyboard layouts.
sunder.tinwar at 27-Jun-11 15:07pm View
   
I perhaps want to create an object which will load setting of current keyboard layout of current culture and get all keys text.
 
Next time I need an event also. If culture change my application should get notification and I will load my keyboard settings again.
sunder.tinwar at 27-Jun-11 12:23pm View
   
http://www.csharphelp.com/2007/01/keyboardlayout-and-language-selector/
http://www.csharphelp.com/2006/02/c-and-apis/
http://keymapper.googlecode.com/svn-history/r283/trunk/keymapper/Classes/AppController.cs
sunder.tinwar at 27-Jun-11 8:15am View
   
few of developers asked same question but no answer. Perhaps you can help me now..
 
http://msdn.microsoft.com/en-us/magazine/cc163824.aspx http://stackoverflow.com/questions/3743140/character-language http://stackoverflow.com/questions/4822261/is-it-possible-to-create-a-keyboard-layout-that-is-identical-to-the-keyboard-used http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/7c891924-6098-4c42-ab77-f4624b4475ef http://bytes.com/topic/c-sharp/answers/227702-converting-char-keyboard-mapped-code
sunder.tinwar at 27-Jun-11 8:15am View
   
Cool all your answers are noway related to my question. Try to analyse the problem statement then answer.
 
http://msdn.microsoft.com/en-us/magazine/cc163824.aspx
http://stackoverflow.com/questions/3743140/character-language
http://stackoverflow.com/questions/4822261/is-it-possible-to-create-a-keyboard-layout-that-is-identical-to-the-keyboard-used
http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/7c891924-6098-4c42-ab77-f4624b4475ef
http://bytes.com/topic/c-sharp/answers/227702-converting-char-keyboard-mapped-code
 
keep doing same and enjoy life...
sunder.tinwar at 27-Jun-11 4:21am View
   
I asked the question again because I was not much clear in last post and you all concluded its easy.
 
The thing is here user can change his/her langauge any moment its not fixed.
The corresponding character pressed say a is something else in arabic and I dont know what it is. How to make its correspondence character.
sunder.tinwar at 26-Jun-11 9:42am View
   
Now what I did is just changed my default language to Arabic now my login screen will not work because one input in English and other in Arabic. By default windows shows Arabic keyboard whenever I type anything but whole application mess up. What should I do now.
sunder.tinwar at 26-Jun-11 9:02am View
   
here I can not create resource file for each language so I have to use concept of windows.
.
selected language from windows and keyboard format of that language.
sunder.tinwar at 23-Jun-11 7:06am View
   
I found very nice tutorial on this link regarind unicode so sharing with you all
 
http://joelonsoftware.com/articles/Unicode.html
sunder.tinwar at 23-Jun-11 6:38am View
   
Is there a way to convert a single key press to the Japanese representation of that key press?
 
It will also resolve my issue.
sunder.tinwar at 23-Jun-11 6:37am View
   
Is there a way to convert a single key press to the Japanese representation of that key press?
 
It will also resolve my issue.
sunder.tinwar at 23-Jun-11 6:30am View
   
I dont want to use any API if solution is possible. I have read that its possible. How facebook will convert you complete profile to some other langauge.
 
Here my client will having a particular language fonts intalled on his machine.
sunder.tinwar at 20-Jun-11 4:33am View
   
Its not the problem with code. As I said other software life sql server configuration manager use WMI, which is getting errored out.
 
Apart from this I download to WMI Tool from msdn download to check WMI code on machine. That also getting errored out. The exe showing same error.
 
I hope now you understand problem is not with code.
sunder.tinwar at 20-Jun-11 4:27am View
   
Hi, its happening when it queries
 
ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'TRUE'");
ManagementObjectCollection queryCollection = query.Get();
foreach (ManagementObject mo in queryCollection) //here on in statement its error out....same in other code when we call get() its will error out...
{
bool dhcpEnabled = Convert.ToBoolean(mo["DHCPEnabled"]);
}
sunder.tinwar at 20-Jun-11 1:59am View
   
thanks shoputer for reply your first solution trial maker looks good. I need to explore more something in this area only. Something like this only.
sunder.tinwar at 20-Jun-11 1:58am View
   
Thanks roger for reply.
sunder.tinwar at 20-Jun-11 1:37am View
   
Thanks Ramalinga...its quite good solution.
sunder.tinwar at 20-Jun-11 1:37am View
   
Thanks Roger, good solution, I will surely keep exploring regarding licensing issues.
 
Hey can you help me with this post
http://www.codeproject.com/Questions/213426/software-distribution-issues-to-clients
 
Thanks
sunder.tinwar at 20-Jun-11 1:13am View
   
Thanks for reply it great knowledge resource, but perhaps you should read my question again. I am asking do we need any licence for I and my client. VS license or any other license required.
sunder.tinwar at 20-Jun-11 1:08am View
   
hi thanks for reply, I know this kind of functionality already exits in many products in market.
 
I want to implement similar functionality. I need idea how to solve this issue.
 
So that I can implement it in my product.
 
Thanks
sunder.tinwar at 5-Jun-11 4:42am View
   
How can i change a exe name while its running?
sunder.tinwar at 5-Jun-11 4:42am View
   
Deleted
How can i change a exe name while its running?
sunder.tinwar at 5-Jun-11 4:41am View
   
hey kim..what i asked is dynamically change the name. How can i change a exe name while its running?
sunder.tinwar at 5-Jun-11 4:35am View
   
sorry Monjurul, The solutions what you gave is not at all useful for me.Why should I use that approach when I have this.Text=Application.ProductName;
 
My requirement is in taskmanager the process name should be visible to x.exe to y.ext
sunder.tinwar at 4-Jun-11 10:00am View
   
hey kim thanks for reply...can you provide some example for reference of any link
sunder.tinwar at 4-Jun-11 9:51am View
   
thanks for reply....can you explain in detail with any example
sunder.tinwar at 4-Jun-11 9:41am View
   
can you give some example by coding c# thats what I am plaining to do but no idea.
sunder.tinwar at 3-Jun-11 11:47am View
   
Thanks but required can not be altered. The one which you are talking about is I am already familiar with.
sunder.tinwar at 1-Jun-11 7:29am View
   
How come windows determine what kind of text it is...when I just press ctrl+c on site page say in arabic language and press ctrl+v in notepade. Text will look exactly same what is in site page.
 
Anyone provide any light on this....
sunder.tinwar at 1-Jun-11 7:26am View
   
Hi I think I did not make my self clear.
public string DownloadWebPage(string Url)
{
// Open a connection
HttpWebRequest WebRequestObject = (HttpWebRequest)HttpWebRequest.Create(Url);
 
// You can also specify additional header values like
// the user agent or the referer:
WebRequestObject.UserAgent = ".NET Framework/2.0";
WebRequestObject.Referer = "http://www.example.com/";
 
// Request response:
WebResponse Response = WebRequestObject.GetResponse();
// Open data stream:
Stream WebStream = Response.GetResponseStream();
 
// Create reader object:
StreamReader Reader = new StreamReader(WebStream);
 
// Read the entire stream content:
string PageContent = Reader.ReadToEnd();
 
// Cleanup
Reader.Close();
WebStream.Close();
Response.Close();
 
return PageContent;
}
this the code i am using to download a web page. Now if a page is in arabic language when it will be stored in a file it should be visible same what it did on site page.
For example now a page arabic is using utf-8 or utf-16 or anything else. I have to use same while writing in file.
How can I get the text in same unicode format.
sunder.tinwar at 26-May-11 1:41am View
   
hey dude i said code is still working fine for remote machine. But problem is in my machine. Now what I need to do to correct it thats what I want to know. This is general WMI code can be found on internet.
sunder.tinwar at 21-May-11 9:46am View
   
Hi michael thanks for reply but I figured out why its happening is I am starting lot of threads from my appliation. When I am closing applicaiton I need to close my threads manually then every thing will go fine for me or use Environment.Exit
Anyhow thanks.
sunder.tinwar at 21-May-11 9:01am View
   
Thanks christian. But when we call Application.Exit it will not go to form closing event. And on button click we can not set e.cancel=true.
 
Help me if you have better answer.
sunder.tinwar at 14-May-11 3:06am View
   
Both codes are same. Even if I copy code from main application and paste in a demo application it will work. But main application does not.
sunder.tinwar at 14-May-11 2:23am View
   
thanks for reply. But my internet connection is working. I will surely check before sending mails.
 
I have already posted this question thrice. I was working on a keylogger project. It was working fine. I took a backup and made some modifications. But now its not working. Mails are just not going to any mail provider by any credentials. But if I copy same code and make a demo app it will work.
sunder.tinwar at 13-May-11 14:14pm View
   
great...how would you think I have not tried that. Its jus not working. I tried every stuff possible. I installed fiddeler to check that http request going fine or not. Is it blocked by antivirus or not.
 
And you just gave me an answer which is waste of time and not even worth or reading.
sunder.tinwar at 9-May-11 8:08am View
   
hi...yes i installed fiddler and it was sending request. but still mail sending failed. for same code if i use in sample application it was sending request and mail send successfully.
I could not figure out whats the issue here.
sunder.tinwar at 6-May-11 6:33am View
   
I copied pasted same code from main application and created a sample application. There it worked. So where I have confusion.
sunder.tinwar at 6-May-11 6:32am View
   
Then whats the issue with main application using same code. Even if I hard code values it will not work. I am no brainer.
sunder.tinwar at 6-May-11 6:13am View
   
But the same code should not be supposed to work with sample code right.
sunder.tinwar at 6-May-11 5:38am View
   
so griff you tried the code it would be working fine for you. So now how to resolve this issue.
sunder.tinwar at 6-May-11 5:37am View
   
I dont think that is the issue. Because the same application is not working for any email id but same code is working for different application for any ID.
sunder.tinwar at 6-May-11 5:26am View
   
Hi griff thanks for reply but you should read question again i am not using MD5 for encrypting data its just for validating that user should not temper with my data.
 
anyhow this is code i am using.
class CryptorEngine
{
public static string Encrypt(string ToEncrypt, bool useHasing)
{
byte[] keyArray;
byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(ToEncrypt);
//System.Configuration.AppSettingsReader settingsReader = new AppSettingsReader();
string Key = "some key";
if (useHasing)
{
MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();
keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(Key));
hashmd5.Clear();
}
else
{
keyArray = UTF8Encoding.UTF8.GetBytes(Key);
}
TripleDESCryptoServiceProvider tDes = new TripleDESCryptoServiceProvider();
tDes.Key = keyArray;
tDes.Mode = CipherMode.ECB;
tDes.Padding = PaddingMode.PKCS7;
ICryptoTransform cTransform = tDes.CreateEncryptor();
byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
tDes.Clear();
return Convert.ToBase64String(resultArray, 0, resultArray.Length);
}
public static string Decrypt(string cypherString, bool useHasing)
{
byte[] keyArray;
byte[] toDecryptArray = Convert.FromBase64String(cypherString);
//byte[] toEncryptArray = Convert.FromBase64String(cypherString);
//System.Configuration.AppSettingsReader settingReader = new AppSettingsReader();
string key = "some key";
if (useHasing)
{
MD5CryptoServiceProvider hashmd = new MD5CryptoServiceProvider();
keyArray = hashmd.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
hashmd.Clear();
}
else
{
keyArray = UTF8Encoding.UTF8.GetBytes(key);
}
TripleDESCryptoServiceProvider tDes = new TripleDESCryptoServiceProvider();
tDes.Key = keyArray;
tDes.Mode = CipherMode.ECB;
tDes.Padding = PaddingMode.PKCS7;
ICryptoTransform cTransform = tDes.CreateDecryptor();
try
{
byte[] resultArray = cTransform.TransformFinalBlock(toDecryptArray, 0, toDecryptArray.Length);
tDes.Clear();
return UTF8Encoding.UTF8.GetString(resultArray, 0, resultArray.Length);
}
catch (Exception ex)
{
throw ex;
}
}
sunder.tinwar at 6-May-11 5:15am View
   
Hi Hemant,
Thanks but I know some guys just copy paste whole website content into a answer so I wrote the line.
Yes I did examine the stack trace inner exception also. I was showing something else. But the same code is working in other sample application and old builds of my application.
I am not sure but may be antivirus blocking my application silently so I wanted answer some experienced programmer.
Thanks
sunder.tinwar at 8-Mar-11 0:39am View
   
can any one got any solution to this problem....
sunder.tinwar at 8-Mar-11 0:31am View
   
hi nithi..please ellaborate more about issue you are facing
sunder.tinwar at 7-Mar-11 6:37am View
   
Yes I do, Yahoo has a API and I am working on It. It seems rediff and hotmail dont have API. Facebook has API. I started working on it. But I haven't find a working example of it.
sunder.tinwar at 7-Mar-11 6:17am View
   
Actually I guided you to use this Application.DoEvents() in delegate of on main foreground thread. so that UI will get refeshed.
 
And in background work or seperate thread we can copy file. From there on each copy of file we can call the delegate. Ill provide you code.
sunder.tinwar at 7-Mar-11 6:12am View
   
I have already checked this post. And I think screen scraping is prohibited. May be I got a solution for yahoo but not for other, so waiting for any relevant answer.
 
If you get any other feasible solution please let me know.

Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid