Query all products ID under a specify category

Q: Is there a way to query all products ID under a specify category?

A: You can use the following commands:

 query_posts('category_name=categoryname')

or

 query_posts( array ('post_type' => 'products', 'category_name'=>' categoryname' ) );